Drop Down List Filter - Value to Clear

5 posts, 1 answers
  1. Chris
    Chris avatar
    23 posts
    Member since:
    Mar 2012

    Posted 07 Mar 2018 Link to this post

    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?

  2. Attila Antal
    Admin
    Attila Antal avatar
    376 posts

    Posted 12 Mar 2018 Link to this post

    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.
  3. Chris
    Chris avatar
    23 posts
    Member since:
    Mar 2012

    Posted 12 Mar 2018 in reply to Attila Antal Link to this post

    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

  4. Answer
    Attila Antal
    Admin
    Attila Antal avatar
    376 posts

    Posted 15 Mar 2018 Link to this post

    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.
  5. Chris
    Chris avatar
    23 posts
    Member since:
    Mar 2012

    Posted 15 Mar 2018 in reply to Attila Antal Link to this post

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

    thanks

    sorry for the unnecessary work

Back to Top