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.
Unfortunately, activation email could not send to your email. Please try again.

How to set the visible position of a column.

Thread ID:

Created:

Updated:

Platform:

Replies:

62302 Jun 12,2007 04:30 PM Jun 12,2007 05:04 PM Windows Forms 1
loading
Tags: GridControl
Roger Seguin
Asked On June 12, 2007 04:30 PM


How do you set the visible position of a column in the syncfusion grid?

Thanks

haneefm [Syncfusion]
Replied On June 12, 2007 05:04 PM

Hi Roger,

For GroupingGrid:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
To programatically change the column position, you need to use the move method in GridTableDescriptor.VisibleColumns property. Below is a code snippet that show this.

//For move columns in a grid.
this.grid.TableDescriptor.VisibleColumns.Move(1,2);

For GridDataBoundGrid:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
To position the columns in the grid, you can use the Binder.LayoutColumns() method. This method rearranges how the columns should be displayed in the grid. Below is the code snippet.

If columns from datasource are populated as Col1, Col2, Col3, Col4, Col5 then you can modify the order of the columns like...

this.gridDataBoundGrid1.Binder.LayoutColumns(new string[] {"Col1", "Col3", "Col5", "Col2", "Col4"});

You can also move columns in the DataBoundGrid, using the grid.Model.Cols.MoveRange method. See the code below,

// moves column 1 to 3
this.gridDataBoundGrid1.Model.Cols.MoveRange(1, 3);

Best regards,
Haneef

CONFIRMATION

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.

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.

;