Hi,
I'm trying to use a mult-checkbox filter like the demo on https://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes.
columns.Bound(c => c.status).Title("Status").Filterable(ftb => ftb.Multi(true)); And it's client side[.ServerOperation(false)].
Currently I have "act" and "inact" value in this column. I want to show only the "act" records when the page is loaded. Is that possible to give a default or pre-checked value to the muti-checkbox?
5 Answers, 1 is accepted
You can use the filter method in order to filter the grid. For example you can execute the following code in the browser console of the Grid / Filter Multi Checkboxes demo to filter the client grid by the Discontinued column with true value:
$(
"#client"
).data(
"kendoGrid"
).dataSource.filter({ logic:
"and"
, filters: [{field:
"Discontinued"
, operator:
"eq"
, value:
true
}] })
Regards,
Danail Vasilev
Telerik by Progress

Thank for your reply. I'm sorry that I didnt get your point.
In the Grid / Filter Multi Checkboxes demo, can I make the checkbox "True" under the Discontinued filter CHECKED BY DEFAULT while the grid is loaded? I tried your code, nothing happens.

You need to ensure that you are trying to get reference to the grid with the correct ID and after its initialization (within document ready).
Another thing that you can try is to set the initial filter directly in the DataSource of the Grid:
.DataSource(dataSource => dataSource
.Ajax()
.Filter(f=>f.Add(x=>x.Discontinued).IsEqualTo(true))
Hope this helps.
Regards,
Konstantin Dikov
Telerik by Progress

.DataSource(dataSource => dataSource
.Ajax()
.Filter(f=>f.Add(x=>x.Discontinued).IsEqualTo(true))
Thanks so much! It works perfect!