To expand or shrink columns during grid resizing, set the SpringMode property to True and the MinWidth property for each column. This can be done either in the designer or in code.
To expand or shrink columns during grid resizing in the designer, complete the following steps:
To expand or shrink columns during grid resizing in code, complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.SpringMode = True |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.SpringMode = true; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.Splits(0).DisplayColumns("First").MinWidth = 50 |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Splits[0].DisplayColumns["First"].MinWidth = 50; |
When the grid is resized horizontally, the columns will expand or shrink proportionally, except for the First column which will only shrink to 50: