This topic demonstrates how to set the width of a column in C1GridView.
A column's width can be specified in code if the column is not automatically generated. To set the column width:
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
C1GridView1.Columns(2).ItemStyle.Width = New Unit(500) |
To write the code in C#:
C# |
Copy Code
|
---|---|
C1GridView1.Columns[2].ItemStyle.Width = new Unit(500); |
wijmo:C1BoundField DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" Width="500">
What You've Accomplished
In this topic you learned how to change the width of a column. In this example, the third column is 500 pixels: