I have a grid which has just one colomn [RoleName] with filtering, multi-filtering enable and it is bound to a data source (Role object- it contains RoleName and RoleID). When the filter renders it displays RoleName. Is there any way that i could change checkbox value to role-ID While the filters still displays RoleName.
@(Html.Kendo().Grid<Keymaster.Models.UserRoleModel>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(c => c.UserID).Width(140).Filterable(
false
);
columns.Bound(c => c.FirstName).Width(140).Filterable(
false
);
columns.Bound(c => c.LastName).Width(140).Filterable(
false
);
columns.Bound(c => c.Role).Width(140).Filterable(f => f.Multi(
true
).UI(
""
).DataSource(source => source.Read(r => r.Action(
"GetRolesForGrid"
,
"UserActivityByRoles"
))));
columns.Bound(c => c.Location).Width(140).Filterable(
false
);
columns.Bound(c => c.LastLogin).Width(140).Filterable(
false
);
})
.HtmlAttributes(
new
{ style =
"height:500px;width:60%;align:center;margin:0 auto"
})
.Scrollable()
.Sortable()
.Mobile()
.Filterable()
.Pageable(pageable => pageable
.Refresh(
true
)
.PageSizes(
true
)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(
"GetRolesForGridForDisplay"
,
"UserActivityByRoles"
))
)
)
img
Thanks,
Dinesh B
13 Answers, 1 is accepted
You can use an itemTemplate in order to set the checkboxes value to RoleID and display RoleName e.g.
.Filterable(f => f.Multi(
true
).UI(
""
).DataSource(source => source.Read(r => r.Action(
"GetRolesForGrid"
,
"UserActivityByRoles"
))).ItemTemplate(
"roleTemplate"
));
function
roleTemplate(e) {
return
'<li><label class="k-label"><input type="checkbox" value="#:data.RoleID#" />#:data.RoleName || data.all#</label></li>'
;
}
Regards,
Daniel
Telerik
See What's Next in App Development. Register for TelerikNEXT.

I am afraid that radio buttons are not supported. The filter menu will search for checkboxes and so no filter values will be found when using radio buttons.
Regards,
Daniel
Telerik
See What's Next in App Development. Register for TelerikNEXT.

I cannot find "Search" in column filter. This line errors out on Search(true).
columns.Bound(c => c.ColumnName).Title(
"Column Name"
).Filterable(f => f.Multi(
true
).Search(true).DataSource(ds => ds.Read(r => r.Action(
"actionname"
,
"controllername"
))));
Can you please let me know
Thanks
Which version are you using? The option is available since the R1 2016(2016.1.112) release.
Regards,
Daniel
Telerik by Progress

Thank you!
I am using Version - 2015.1 408. I will upgrade and see how it works.

It worked great after upgrading to version: 2016.3.1028. I had to update these files
1. The kendo.Mvc dll
2. The script files kendo.all.min.js and kendo.aspnetmvc.min.js
3. The style files kendo.bootstrap.min.css and kendo.common.min.css
4. All the Images in Bootstrap folder
5. KendoUIGlyphs.ttf and KendoUIGlyphs.woff files in fonts folder
Thanks

How do i Filter if a column cell has one or more values that are in filter list. In the attached images you can see QaQcComment has both MIN Base Type Code, Used DMR Data that are in the filter menu. If i filter any one or both of MIN Base Type Code, Used DMR Data from filter menu, grid is not filtering. How can i do that?
Thanks
Raj
Can you confirm if you are using server operations? Is it possible that the Kendo UI Grid is filtering but the performance is poor?
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.multi
You could test by providing a separate data source for the checkboxes. Here is a simple JavaScript example:
http://dojo.telerik.com/oGuhah
If this is not the case, could you elaborate on the current behaviour and the desired outcome so I can advise accordingly? Alternatively, please modify the provided Dojo along with a brief explanation/steps to reproduce the Kendo UI multi-check filterable Grid not filtering?
Alex Hajigeorgieva
Telerik by Progress

Yes i am Using Server Operations to get the grid filter menu options and also filter is working if the column has values that are same in the filter options. But if there are more than one values in the column separated by a comma then that column is not getting filtered. please go through the Images i have provided in my previous post.
You can see QaQcComment Column in grid has both MIN Base Type Code, Used DMR Data separated by a comma (FYI in capture.png)
If you see in the filter options there are both Base Type Code, Used DMR Data as separate Check boxes, Now if i filter by MIN Base Type Code check Box Value I am not getting the rows that you can see in capture.png Image
Also Im attaching a new Image(OtherRows.Png) that shows the other rows with other QaQcComment column values which works fine when filtered.
This scenario is not supported out of the box by the Kendo UI Grid.
Once a value is selected from the filter menu, the Grid is searching for a direct match which is not found.
This can be only done using a custom filtering logic on the server as the Grid will send a filter operator equal, which have to be replaced with contains on the server, and then the server should return all of the items which contain the chosen value.
Regards,
Stefan
Telerik by Progress

Can you provide a sample code that overrides the filter operator 'Isequalto' to 'Contains' When used Multi Checkboxes?
Thanks
Raj
As mentioned in the previous reply the Grid will send the request with the equal operator, and this behaviour cannot be modified from the Grid, the operator logic can be changed only programmatically on the server.
I can suggest submitting a feature request to changed the filter operator when the checkbox filtering is used:
http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/category/170280-grid
Regards,
Stefan
Telerik by Progress