Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the correct syntax to set the filter so it will only display loans with a non-zero balance in the grid?

C#
@(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?
Posted

1 solution

Read this[^].
 
Share this answer
 
Comments
littleGreenDude 19-Mar-14 8:50am    
Thank you, but the link was only slightly helpful. The MVC example is weak. It only covers compound/complex filters that are joined by a logical operator. I just need the syntax for a single field comparison.
Dave Kreskowiak 19-Mar-14 9:29am    
Filtering in MVC is easy. I thought you were doing it in script on the client side.

In your DataSource, it's just:
.DataSource(dataSource => dataSource
// other DataSource setup code...
.Filter(filters =>
{
filters.Add(c => c.CurrentLoanBalance).IsGreaterThan(0);
})
)

I know what you mean about the documentation. It's the worst I've seen on any library.
littleGreenDude 19-Mar-14 9:39am    
Awesome! That worked! Thank you very much.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900