Hi Matyas,
To rearrange columns in grid, you can use the Binder.LayoutColumns(). This method rearranges how the columns should be displayed in the grid.
Please try the code below after the binding the datasource to the grid. This will rearrange the columns as desired.
this.gridDataBoundGrid1.Binder.LayoutColumns(new string[] {"Col2", "Col5", "Col3", "Col1", "Col4"});
--OR---
You can also move columns in the DataBoundGrid, using the grid.Model.Cols.MoveRange method.
See the code below,
// moves column 1 to 3
this.gridDataBoundGrid1.Model.Cols.MoveRange(1, 3);
//moves column 1 & 2 to 4
this.gridDataBoundGrid1.Model.Cols.MoveRange(1,2,4);
Here is a sample demonstrating this.
MoveColumns.zipIf you dont want certain columns to displayed, then you can hide them as in the code below.
this.gridDataBoundGrid1.Model.HideCols["colName"] = true;
//or
this.gridDataBoundGrid1.Model.HideCols[colindex] = true;
Thankyou,
S.Shyam.