To change the column order in the grid, use the C1TrueDBGrid Designer or set RemoveAt and Insert methods in code.
To change the grid column order in the Designer, complete the following steps:
To change the grid column order in code, complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim dispColumn As C1.Win.C1TrueDBGrid.C1DisplayColumn dispColumn = Me.C1TrueDBGrid1.Splits(0).DisplayColumns(2) |
To write code in C#
C# |
Copy Code
|
---|---|
C1.Win.C1TrueDBGrid.C1DisplayColumn dispColumn; dispColumn = this.c1TrueDBGrid.Splits[0].DisplayColumns[2]; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.Splits(0).DisplayColumns.RemoveAt(2) Me.C1TrueDBGrid1.Splits(0).DisplayColumns.Insert(0, dispColumn) |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Splits[0].DisplayColumns.RemoveAt(2); this.c1TrueDBGrid1.Splits[0].DisplayColumns.Insert(0, dispColumn); |
The Country column appears in the grid before the First column: