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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reorder GridDataBoundGrid columns programatically

Thread ID:





44550 May 26,2006 08:02 AM UTC May 26,2006 08:55 AM UTC WinForms 1
Tags: GridControl
Nick Gardner
Asked On May 26, 2006 08:02 AM UTC

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.

Administrator [Syncfusion]
Replied On 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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon