Excluding enum values from grid column filter

2 posts, 0 answers
  1. aron
    aron avatar
    3 posts
    Member since:
    Apr 2018

    Posted 04 Jun 2018 Link to this post

    Hello! I have a scenario in which i have a dropdownlist (in a column) with enum-values for filtering. The data that gets sent to the grid only contains items whose order status is of the UsefulUiValue variety, but since the property OrderStatus is MyEnum, all of the enum values are added to the filter-dropdown for the column. Is there any way to tell the filter or the grid to only take the enum values i want? 
    01.public enum MyEnum
    02.{
    03.    UsefulUiValue1, //Useful for filtering in the grid
    04.    UsefulUiValue2, //Useful for filtering in the grid
    05.    UsefulUiValue3, //Useful for filtering in the grid
    06.    Value4, //Not useful for filtering in the grid (should be excluded from dropdown filter)
    07.    Value5, //Not useful for filtering in the grid (should be excluded from dropdown filter)
    08.}
    09. 
    10.public class MyClass
    11.{
    12.    public MyEnum OrderStatus { get; set; }
    13.    public DateTime OrderDate { get; set; }
    14.    public decimal OrderSum { get; set; }
    15.}
  2. Stefan
    Admin
    Stefan avatar
    2950 posts

    Posted 06 Jun 2018 Link to this post

    Hello, Aron,

    Thank you for the details.

    Please check the following forum post with a similar scenario, where the user is given the options to filter only on some of the enum values:

    https://www.telerik.com/forums/kendo-grid-filter-enum-

    I hope this is helpful.

    Regards,
    Stefan
    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.
Back to Top