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

Reordering columns in a GridDataBoundGrid

Hi, I'm trying to create a UI to allow clients to control some basic column properties (colors, width, hide, and column order). The grid is a GridDataBoundGrid. At this point, I can handle the colors and header text by creating a GridBoundColumns collection fot the grid. Interstingly, width, and hide appear to be part of the Grid.Model, each as a seperate column indexed collection. My assumption is that reordering columns is simply a matter of the order the are added to the GridBoundColumns. The concern is what does this do to the size mappings in the grid model? How do they get remapped to follow the new column order? I've checked out the example at http://www.syncfusion.com/faq/winforms/search/764.asp but it appears to be specific for GridControls. Am I barking up the wrong tree? It seems that I should just be able to create a new bound columns collection, set the properties for each column and apply the collection. Any suggestions or examples would be greatly appreciated. Thanks, Doug Lind Panther Systems

1 Reply

AD Administrator Syncfusion Team September 19, 2003 11:19 AM

If you use the this.gridDataBoundGrid1.Model.Cols.MoveRange method to move you columns (or allow you user to use the default drag column support), then the column sizes should move appropriately without further work.

Loader.
Live Chat Icon For mobile
Up arrow icon