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

Reorder GridDataBoundGrid columns programatically

I''m implementing a column builder to allow the user to set (from a custom form) which columns are visible and their display order. I''ve sorted out the visible side of things using Model.Cols.Hidden, how can I set the order from code? The grid displays data from a DataView based on a DataTable.

1 Reply

AD Administrator Syncfusion Team May 26, 2006 08:55 AM UTC

Hi Nick, To rearrange the columns of the grid, you need to use the Binder.LayoutColumns(). The LayoutColumns() rearranges how the columns should be displayed in the grid and allows you to specify covered cells and / or break records into several rows displayed in the grid. Here is some code snippet this.gridDataBoundGrid1.Binder.LayoutColumns( "Id","Points","Name"); Here is a sample. http://www.syncfusion.com/Support/user/uploads/contextMenu_fb5f7280.zip Please let me know if this helps. Best Regards, Haneef Please note : "-" indicates a covered cell, "." indicates a new row, "" specifies an empty "whitespace" column.

Loader.
Live Chat Icon For mobile
Up arrow icon