Posted 22 October 2017, 11:08 pm EST
Hi,
I’m wondering if i can set a property preventing the user from filtering a specific column?
i control filtering in code-behind and don’t want the user to see the Filter icon on the column…
Thank you,
Guy
Forums Home / ComponentOne / WPF Edition
Posted by: Guy on 22 October 2017, 11:08 pm EST
Posted 22 October 2017, 11:08 pm EST
Hi,
I’m wondering if i can set a property preventing the user from filtering a specific column?
i control filtering in code-behind and don’t want the user to see the Filter icon on the column…
Thank you,
Guy
Posted 24 October 2017, 9:36 pm EST
Hi Guy,
You can use grid’s ColumnFilter for the purpose. Please refer the application implementing the same for the Country column:
https://www.dropbox.com/s/qjuhzpq8c4vkx6p/FlexGrid_ColumnFilterIssue.zip?dl=0
Thanks,
Pragati
Posted 26 October 2017, 6:19 pm EST
Hi Pragati,
Thank you for your answer and sample.
However - Once i set a filter via code behind these settings are cleared and i can see the filter icons again…
Thank you,
Guy
Posted 27 October 2017, 6:05 pm EST
Hi Guy,
As per my understanding of your requirement, it seems you wish to set the filter for specific columns (via Code-Behind) but prevent the user from applying/modifying the filter for those columns. If it is so, then once you have set the filter for the column(s) then you may specify that column’s Filter.FilterType to None. Please refer attached image for code-snippet and corresponding output.
Also, I have uploaded a sample application for your reference: https://www.dropbox.com/s/z6fy04ltnkr2r0o/FlexGrid_ColumnFilterIssue.zip?dl=0
_flex.EnableFiltering(false);
Regards,
Ruchir Agarwal