Posted 31 January 2019, 5:29 am EST
Hello,
I want to sort my flexGrid wich bound to DataTable only on load form or on request
how can I disable sort after user update the flex values
Thanks,
Ynit
Forums Home / ComponentOne / WinForms Edition
Posted by: yonit.chavshosh on 31 January 2019, 5:29 am EST
Posted 31 January 2019, 5:29 am EST
Hello,
I want to sort my flexGrid wich bound to DataTable only on load form or on request
how can I disable sort after user update the flex values
Thanks,
Ynit
Posted 1 February 2019, 3:05 am EST
Hello,
Please set the “AllowSorting” to false in the “AfterEdit” event. Sorting will be disabled when user edit the cell content:
private void C1FlexGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
c1FlexGrid1.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.None;
}
Hope it helps.
Thanks.
Posted 3 February 2019, 2:35 am EST
Hi mohitg
Thank you for replying,
I tried it but the flexgrid is still sorted after update
( the sort is written in the form_load event - I dont mean only for user sorting)
Do you hve another idea???
Thanks
Posted 4 February 2019, 5:56 am EST
Hello,
To achieve your requirement, you need to add an extra column in the datatable from which grid has bound. On sorting the column, you need to copy the data from “Sorting” column to the above added extra column and sort the grid with extra column through custom sorting. Please refer to the attached sample.
Thanks.