Posted 2 October 2017, 11:39 pm EST
Hi
I used the sort function on the grid and used the filter function.
The afterfilter event occurs after sorting certain columns.
I want to know why.
my grid version is 4.0.20172.274.
Forums Home / ComponentOne / WinForms Edition
Posted by: downrader on 2 October 2017, 11:39 pm EST
Posted 2 October 2017, 11:39 pm EST
Hi
I used the sort function on the grid and used the filter function.
The afterfilter event occurs after sorting certain columns.
I want to know why.
my grid version is 4.0.20172.274.
Posted 3 October 2017, 9:07 am EST
Hi,
This happens when the AllowFiltering property is set to True in the Designer or anyhow before using the Sort function.
If you wish that the AfterFilter (or even BeforeFilter) event does not fire while using Sort function then please set the AllowFiltering after using the Sort function as follows:
c1FlexGrid1.Sort(C1.Win.C1FlexGrid.SortFlags.Ascending, 2, 4);
c1FlexGrid1.Sort(C1.Win.C1FlexGrid.SortFlags.Ascending, 3);
[b]c1FlexGrid1.AllowFiltering = true;[/b]
var filter = new C1.Win.C1FlexGrid.ConditionFilter();
filter.Condition1.Operator = C1.Win.C1FlexGrid.ConditionOperator.LessThan;
filter.Condition1.Parameter = "J";
c1FlexGrid1.Cols["Country"].Filter = filter;
Regards,
Ruchir Agarwal