Hi Jimmyd,
You would turn off the default sorting with the SortBehavior property. Then handle CellDoubleClick and do the sorting using Binder.Sort() method. Here is a code snippet to show this.
//turn OFF the Default sortbehavior....
this.gridDataBoundGrid1.SortBehavior = GridSortBehavior.None;
this.gridDataBoundGrid1.CellDoubleClick +=new GridCellClickEventHandler(gridDataBoundGrid1_CellDoubleClick);
private void gridDataBoundGrid1_CellDoubleClick(object sender, GridCellClickEventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
int fieldIndex = grid.Binder.ColIndexToField(e.ColIndex);
if( e.ColIndex == 2)
{
fieldIndex = grid.Binder.ColIndexToField(4);
}
if( fieldIndex != -1)
{
grid.BeginUpdate();
grid.Binder.Sort(fieldIndex);
grid.EndUpdate(true);
grid.Refresh();
}
}
Please refer to the attached sample for implementation.
ChangeSortColumnbehavior.zipBest Regards,
Haneef