Kendo MVC grid filtering

2 posts, 1 answers
  1. littleGreenDude
    littleGreenDude avatar
    17 posts
    Member since:
    Jan 2014

    Posted 18 Mar 2014 Link to this post

    What is the correct syntax to set the filter so it will only display loans with a non-zero balance in the grid?

    @(Html.Kendo().Grid<BorrowerLoan>()
        .Name("Loans")
        .Events(events => events.DataBound("onDataBound"))
        .DataSource(dataSource => dataSource  
            .Ajax()
            .ServerOperation(false)
            .Read(read => read.Action("LoanListAjax", controller))
            .PageSize(Constants.PageSize)
            .Filter(CurrentLoanBalance > 0)
            )

    What should the ".Filter(CurrentLoanBalance > 0)" be?

  2. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 21 Mar 2014 Link to this post

    Hello Stephen,

    Adding a filter is done by using the filter's add method. For example: 
    .Filter(f=>f.Add(e=>e.CurrentLoanBalance).IsGreaterThan(0))


    Regards,
    Alexander Popov
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
Back to Top