private void _flex_BeforeSort(object sender, C1.Win.C1FlexGrid.SortColEventArgs e) { // cancel built-in sorting e.Cancel = true; // sort using custom comparer IComparer comp = new NullComparer(sender as C1FlexGrid, e); _flex.Sort(comp); // update display and current sort order _flex.ShowSortAt(e.Order, e.Col); }