I'm trying to add a DropDownList list for grid / filter menu customization per http://demos.telerik.com/aspnet-mvc/grid/filter-menu-customization. If I return a list of strings to the DropDownList list, it works just find. However if I return a list of classes and use the DataTextField and DataValueField properties, the user has to select the item a second time to get an item to select and when you click Filter you get nothing in the list:
I can return strings instead of class instances but it seems that the latter really should work.
6 Answers, 1 is accepted
I am afraid that the issue is not a known one, nor is reproducible in our online demos. I prepared a sample http://dojo.telerik.com/unAHA example that implements very similar scenario:
- The DropDownList in the filter row template is bound to remote data.
- As soon as item is selected the Kendo UI Grid is filtered properly by the text of the selected item.
I'm using Razor. Here is an example that displays the problem using version 2015.3.930 (tested with IE10 and latest Firefox and Chrome).
The problem is that the dataValueField option should be with capital "F". In the provided code it is written "dataValuefield".
In a SQL query I have case statement to produce a field name. For e.g:
WHEN 0 THEN 'In-active'
WHEN 1 THEN 'Active'
END AS user_status
Now when I try to filter the grid by the user_status it fails because the grid is passing the text value not the numerical value.
Hence I am trying to use the customized dropdown list but I couldn't figure out passing key value pair of datasource.
optionLabel:"-- Select One --"
this is not working can you please help?
I believe that the problem is the DataSource definition. Currently there is only one item in the DataSource with two properties. I guess that you are expecting to have two items in the DataSource with same text and value properties. Please refer to the following dataSource configuration for such scenario: