0

I'm trying to adjust the xceed datagrid at runtime and cannot find a setting for this, anyone have any experience with it?

Shai UI
  • 50,568
  • 73
  • 204
  • 309

3 Answers3

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);
 }
demonplus
  • 5,613
  • 12
  • 49
  • 68
podzach
  • 49
  • 8
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