AD
Administrator
Syncfusion Team
August 19, 2004 10:47 AM UTC
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.