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.

Dragging Columns on a Data Bound Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

17901 Aug 19,2004 06:17 AM Aug 19,2004 06:47 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 19, 2004 06:17 AM

I''m sure I''ve been able to reorder columns on a GridDataBoundGrid by dragging and dropping. Playing with the "DataBoundSortByDisplayMember" sample I cannot get this to work. Is it supported? What do I need to change in the sample to get this to work? With GridGroupingControl is just works. I''m using SyncFusion 2.1.0.9. Thanks, Ben.

Administrator [Syncfusion]
Replied On August 19, 2004 06:47 AM

That sample turned off column moving so a single click could sort the column instead of selecting it for moving. To turn it back on, you simply do step 5 below. But this may look strange to you as it sorts and selects for moving at the same time. One work around would be to use a double click to sort. But this requires more than just setting the SortBehavior property in the sample since the sample uses events to change the default sort behavior. Below are the steps I took to make that sample sort on a double click and select for moving on a single click. 1) In gridDataBoundGrid1_CellClick, set bool VersionGreater1618 = true; 2) COmment out the OnCellClick override in the derived class, DataBoundGrid. (Or don''t use it). 3) Instead of subscribing to grid.CellClick, subscribe to grid.CellDoubleClick to sort on a double click. You can use the exact same handler, gridDataBoundGrid1_CellClick, as the CellClick used (with the change from #1). 4) change grid.SortBehavior property to none (instead of double click). This is in two places. 5) Add the GridSelectionFlags.Column flag to the this.gridDataBoundGrid1.AllowSelection property.

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.

;