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

Set default filter at runtime

1 Answer 452 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Riccardo
Top achievements
Rank 1
Riccardo asked on 02 Dec 2019, 11:35 AM

Can i set a default preset filter value for a grid at runtime? 

I'd like to add a isEqualTo value from jquery or similar

.Filter(f => f.Add(a => a.OperatorID).IsEqualTo( ? ))

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 05 Dec 2019, 12:52 PM

Hello Riccardo,

The IsEqualTo operator accepts a value of the same type as the type of model property bound to the column:

.DataSource(dataSource => dataSource
        .Ajax()
        .Filter(filter => filter.Add(a => a.ProductName).IsEqualTo("Chai"))
         ....

In the example above the IsEqualTo accepts a string as the ProductName is of type string.

Please try this and let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Riccardo
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or