Here is example code showing how to disable or enable sorting on columns:
[C#]
private void SetAllowSorting(FlyGrid flyGrid, bool allow, bool onlyToVisibleColumns)
{
if (onlyToVisibleColumns)
{
foreach(Column col in flyGrid.Columns.VisibleColumns)
{
col.AllowSorting = allow;
}
}
else
{
foreach(Column col in flyGrid.Columns.Items)
{
col.AllowSorting = allow;
}
}
}
or you can set AllowSorting to some column by index:
[C#]
private void SetAllowSorting(FlyGrid flyGrid, int index, bool allow)
{
flyGrid.Columns.Items[index].AllowSorting = allow;
}
To disable sorting on all columns you can use followin code:
[C#]
flyGrid.Columns.Options &= ~(ColumnsOptions.ChangeSortOrderOnClick | ColumnsOptions.ShowSortOrderMark);