Setting default filter

3 posts, 1 answers
  1. Jacob
    Jacob avatar
    45 posts
    Member since:
    Sep 2014

    Posted 28 Apr 2015 Link to this post

    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. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2299 posts

    Posted 28 Apr 2015 Link to this post

    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.

     
  3. Jacob
    Jacob avatar
    45 posts
    Member since:
    Sep 2014

    Posted 12 May 2015 in reply to Dimiter Madjarov Link to this post

    Much Appreciated !!
Back to Top