This is a migrated thread and some comments may be shown as answers.

Excluding enum values from grid column filter

1 Answer 581 Views
Grid
This is a migrated thread and some comments may be shown as answers.
aron
Top achievements
Rank 1
aron asked on 04 Jun 2018, 07:52 AM
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.}

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 06 Jun 2018, 05:31 AM
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.
Tags
Grid
Asked by
aron
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or