This is a migrated thread and some comments may be shown as answers.
Drop Down List Filter - Value to Clear
4 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 07 Mar 2018, 02:13 PM

I successfully implemented a custom filter class which manipulates a drop down list of possible values

https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/filter-with-ms-dropdownlist-instead-of-textbox-

one thing remains - what should the value be to clear the filter - and do I need to add code to the class selected index event handler?

the example clears the textbox for all selections - but can't I selectively clear a filter?

4 Answers, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 12 Mar 2018, 08:34 AM
Hi Chris,

One option to clear the filter value is to add a list item to the DropDownList with an empty value as demonstrated in the Grid - Filter Templates demo. You can also add an "x" button next to the DropDownList when there are filters applied, and by clicking on it, clear the filter of that specific column.

Please give the above suggestion a try and see if works for you.

Kind Regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chris
Top achievements
Rank 1
answered on 12 Mar 2018, 02:28 PM

I already had a blank list item as the first item

I added code in the custom filter class selected item event handler to use the "No Filter" option

0
Accepted
Attila Antal
Telerik team
answered on 15 Mar 2018, 01:19 PM
Hi Chris,

I've prepared a basic sample project resembling the described scenario and attached it to my response. Please check it out to see how the filtering is handled as well clearing the filter values.

I hope this will prove helpful.

Kind regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chris
Top achievements
Rank 1
answered on 15 Mar 2018, 09:28 PM

by the time you got back to me I figured it out myself

thanks

sorry for the unnecessary work

Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Chris
Top achievements
Rank 1
Share this question
or