I'm trying to adjust the xceed datagrid at runtime and cannot find a setting for this, anyone have any experience with it?
Asked
Active
Viewed 2,989 times
3 Answers
2
I am using Xceed's DataGridControl and its exactly as Matt sketched it. If your control is named dgCtrl, the code behind would look like this:
dgCtrl.Columns[0].Width = 100; // Sets the column's width to 100px.
You can also use the column names (FieldName property) to access the Columns:
dgCtrl.Columns["Address"].Width = 100;
Xceed's grid offers various options to adjust the width of the columns automatically at run-time. Refer to their online documentation for more info.

olli-MSFT
- 2,556
- 19
- 19
0
foreach (Xceed.Grid.Column column in grdInterstitialView.Columns)
{
column.Width = (int)(column.GetFittedWidth() * 1.1M);
}
-
It's better to include some context/explanation with code as this makes the answer more useful for the OP and for future readers. – EJoshuaS - Stand with Ukraine Jan 10 '17 at 23:00
0
I haven't used the xceed datagrid, but does it not have a columns property like the normal one?
dataGrid.Columns[2]...

Matt West
- 2,874
- 1
- 19
- 13