Home - Forums-.NET - FlyGrid.Net (Windows Forms) - sorting the grid while in virtual mode

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

sorting the grid while in virtual mode
Link Posted: 01-Oct-2005 21:12
hi all.
when i'm working in virtual mode, ans the grid shows the first column as a  tree and the folowing columns as a table - the sort dosent work!!
why??
should i write any code to sort it?
Link Posted: 03-Oct-2005 12:55
In virtual mode you should implement sorting on the data source that provides  data for displaying in the FlyGrid.
In this case you should handle FlyGrid.ColumnSortChanging event to handle column sort order change and sort data within handler of this event.
If sort procedure is succesfully finisihed set sorted argument of this event to true.

[c#]
private void InitFlyGrid(FlyGrid flyGrid)
{
  //connect to the ColumnSortOrderChanging
  flyGrid.ColumnSortOrderChanging +=
ColumnSortOrderChangingHandler(OnColumnSortChanging);
}
private void OnColumnSortOrderChanging(object sender, object column, SortOrder value, ref bool sorted)
{
  sorted = SortOnColumns(flyGrid.Columns.SortColumns);
}

private void SortOnColumns(Coumn[] sortColumns)
{
  //here is your sorting procedure
}