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

Setting default filter

2 Answers 3638 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 28 Apr 2015, 09:28 AM

Hi,

How do I add a default filter on a kendo.grid ?

I have a filter on a boolean, which is working just fine, but I would like TRUE to be the selection by default.

I am quite sure that I have done this before and then removed it again, and now I can't remember howto :-(

I'am aware, that server side operations require more than just setting the default filter selection, but once I have figured out how to set the filter in the view, then I figure out the rest.

So, how to set default filter in the view ??

Thank you in advance.

2 Answers, 1 is accepted

Sort by
2
Accepted
Dimiter Madjarov
Telerik team
answered on 28 Apr 2015, 01:57 PM

Hello Jacob,

You could use the Filter method of the dataSource in this case:

.DataSource(dataSource => dataSource
    .Ajax()        
    .Filter(f => f.Add(a => a.Discontinued).IsEqualTo(true))   

Regards,
Dimiter Madjarov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Jacob
Top achievements
Rank 1
answered on 12 May 2015, 09:29 AM
Much Appreciated !!
Tags
Grid
Asked by
Jacob
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Jacob
Top achievements
Rank 1
Share this question
or