We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Change column order

Hello, When I attach a data set to a data bound grid, the columns order in the grid is derived from the fields order in the data set. Is there a way I can control\override the columns order at runtime? (without changing the fields order in the data set offcourse...) Thanks in advance, Gil K

1 Reply

AD Administrator Syncfusion Team May 23, 2004 10:04 AM UTC

You create GridBoundColumn objects for each column you want to see, and add them to the grid.GridBoundColumns collection using grid.GridBoundColumns.Add. The grid should only show the columns in this collection, and in the order that you set them. (For each GridBoundColumn object, make sure you set its MappingName property to the ColumnName for the column in your DataTable. This is how th egrid identifies the columns, and it is case sensitive.)

Loader.
Live Chat Icon For mobile
Up arrow icon