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

Setting Column Order

I have a grouping grid and bound to a DataSet. What is the easiest way of setting properties for various columns? At the moment I''ve got: grid.TableDescriptor.Columns["MyColumn"].HeaderText = "My Column"; grid.TableDescriptor.Columns["MyColumn"].Width = 40; and so on. I was want to adjust the order of columns, the only way I can see of doing this is to use grid.TableDescriptor.Move which requires column indexes. Thanks, Ben.

1 Reply

AD Administrator Syncfusion Team June 10, 2004 09:52 AM UTC

Hi Ben, there are multiple ways to rearrange columns: The column order can be modified by adding columns in the the order you want them to appear to the GridTableDescriptor.VisibleColumns collection. Example: this.groupingGrid1.TableDescriptor.VisibleColumns.Add("CustomerID"); this.groupingGrid1.TableDescriptor.VisibleColumns.Add("CompanyName"); Or you could also add them in the order you want them to appear to the GridTableDescriptor.Columns collection (see the CategoryView example). The designer also lets you modify the order of columns through collection editors when you click on the ellipsis button of the "Columns" or "VisibleColumns" collection. The "Preview and Edit" mode in design time also lets you drag columns around. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon