Posted 14 December 2017, 3:48 am EST
Hi,
Using C1.Win.FlexGrid version 4.0.20173.282 how can i set the initial state of the checkboxes for the ValueFilter?
I want to have it defauled as UnChecked…
Thank you,
Guy
Forums Home / ComponentOne / WinForms Edition
Posted by: Guy on 14 December 2017, 3:48 am EST
Posted 14 December 2017, 3:48 am EST
Hi,
Using C1.Win.FlexGrid version 4.0.20173.282 how can i set the initial state of the checkboxes for the ValueFilter?
I want to have it defauled as UnChecked…
Thank you,
Guy
Posted 15 December 2017, 5:36 am EST
Hi Guy,
Setting the initial state for all the checkboxes in ValueFilter to unchecked, would mean that no values are selected, therefore the grid would not show any records.
Anyhow, you may get the filter using the following code snippet:
var col = _flex.Cols["ShipRegion"];
col.AllowFiltering = AllowFiltering.ByValue;
var vf = col.Filter as ValueFilter;
[b]vf.ShowValues = new object[] {"CA","BC"};[[/b]/code]
Also, I suggest you to refer attached image, showing possible implementations for ValueFilter.
Hope it helps.
Thanks,
Ruchir Agarwal[img]public\uploads\b176d0973c5d68fa9e59ba45a01372cb1513330524484.png[/img]
Posted 18 March 2018, 6:50 am EST
Hi Ruchir,
i know this is a relatively old post but i still need some help here…
I need to show the user a “clean slate” when the filter is 1st shown - that is whenever the filter editor is opened and the column filter in not active.
I know that if the user presses ‘Apply’ it will essentially clear the grid - that’s fine.
The solution you provided above actually sets the filter so even if the user cancels the filter is still there and it affects other filters/interactions.
So -
How can i set the initial state of the checkboxes for the ValueFilter?
I need to have them UnChecked when there is no filter…
Guy
Posted 19 March 2018, 9:38 am EST
Hello Guy,
Thank you for explaining it further.
Changing the state of checkboxes without applying filter and still showing all the records in grid, does not seem to be likely possible without any affecting other parts. Hence, we are discussing the same with the development team {ID: 314253}.
I will get back to you once we receive any information.
Regards,
Ruchir Agarwal
Posted 18 June 2018, 9:49 am EST
Hi Guy,
Sorry, but it’s impossible, C1FlexGrid uses a ListBox and haven’t public api for checkboxes.
However, you can use custom filter, I have attached a simple example for this, please see “CustomizeFilters_workaround.zip”.
More info: https://www.grapecity.com/en/samples/customfilters
Thanks,
Ruchir
CustomizeFilters_workaround.zip