Completed
Last Updated: 15 Oct 2015 11:57 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 02 Oct 2015 12:40
Category: GridView
Type: Bug Report
0
FIX. RadGridView - columns width is not respected if you set it after setting RadGridView.ViewDefinition to a ColumnGroupsViewDefinition
To reproduce:

for (int i = 0; i < 5; i++)
{
    this.radGridView1.Columns.Add("Col" + i);
}

ColumnGroupsViewDefinition columnGroupsView = new ColumnGroupsViewDefinition();
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup());


columnGroupsView.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[0].Rows[0].ColumnNames.Add("Col3");


columnGroupsView.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[1].Rows[0].ColumnNames.Add("Col2");
columnGroupsView.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[2].Rows[0].ColumnNames.Add("Col0");
columnGroupsView.ColumnGroups[2].Rows[1].ColumnNames.Add("Col1");

columnGroupsView.ColumnGroups[3].Rows.Add(new GridViewColumnGroupRow());  
columnGroupsView.ColumnGroups[3].Rows[0].ColumnNames.Add("Col4");

this.radGridView1.ViewDefinition = columnGroupsView;

this.radGridView1.Columns["Col2"].Width = 150;
this.radGridView1.Columns["Col0"].Width = 200;


Workaround: either set the columns width before setting the RadGridView.ViewDefinition or call the TableElement.ViewElement.RowLayout.InvalidateRenderColumn after specifying the width.
0 comments