Completed
Last Updated: 22 Oct 2015 09:48 by ADMIN
ADMIN
Ralitsa
Created on: 14 Sep 2015 10:11
Category: GridView
Type: Bug Report
1
FIX. RadGridView - the indent column is moved after the columns when the GroupIndent is set to 1
To reproduce: 
public Form1()
{
    InitializeComponent();
    this.Text = Telerik.WinControls.VersionNumber.MarketingVersion + " " + Telerik.WinControls.VersionNumber.Number;
    this.radGridView1.Dock = DockStyle.Fill;

    string[] coffeeDrinks =
    {
        "Americano",
        "Cafe Crema",
        "Caffe Latte",
        "Caffe macchiato",
        "Coffee milk",
        "Cafe mocha",
        "Irish coffee",
    };

    DataTable tableDrinks = new DataTable();
    tableDrinks.Columns.Add("DrinkID", typeof(int));
    tableDrinks.Columns.Add("Drink", typeof(string));
    tableDrinks.Columns.Add("State", typeof(bool));

    for (int i = 0; i < coffeeDrinks.Length; i++)
    {
        if (i % 2 == 0)
        {
            tableDrinks.Rows.Add(i, coffeeDrinks[i], true);
        }
        else
        {
            tableDrinks.Rows.Add(i, coffeeDrinks[i], false);
        }
    }

    this.radGridView1.DataSource = tableDrinks;

    GroupDescriptor descriptor = new GroupDescriptor();
    descriptor.GroupNames.Add("State", ListSortDirection.Ascending);
    this.radGridView1.GroupDescriptors.Add(descriptor);
    this.radGridView1.MasterTemplate.ExpandAllGroups();

    this.radGridView1.TableElement.GroupIndent = 1;
}

When set the GroupIndent property to 1, the space should be 1 pixel. Currently is bigger than 1 pixel (see attached image). And when users wants to hide the indent column, can not set the GroupIndent property to 0. 

Workaround: 
this.radGridView1.TableElement.GroupIndent = 1;
foreach (GridViewColumn col in this.radGridView1.TableElement.ViewElement.RowLayout.RenderColumns)
{
    if (col is GridViewIndentColumn)
    {
        col.MinWidth = 0;
        break;
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments