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

Kendo Grid Pre-Filtering.

2 Answers 228 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ermish
Top achievements
Rank 1
Ermish asked on 15 Oct 2013, 12:30 PM
Hello!

I am trying to pre filter my Kendo Grid, but have not found a way to do so.
 The filtering works just fine; I just need a way to initialize the filter on setup.

Code Snippet:
.Columns(columns =>
                          {
                              columns.Bound(p => p.myColumn)
                                               .Filterable(f => f.Extra(false))
                                               .Title("MyColumn");           
                           })
.Filterable(x => x.Enabled(true)
                               .Operators(o => o.ForEnums(e => e.Clear()
                                                                                                  .IsEqualTo("Is equal to")
                                                                                                  .IsNotEqualTo("Not equal to")))
)

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 15 Oct 2013, 01:42 PM
Hello Ermish,

Pre-defined filters are set in the DataSource configuration through the DataSourceFilterDescriptorFactory.
For example:
.Filter(filter => filter.Add(/* your filter rule */))


Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ermish
Top achievements
Rank 1
answered on 15 Oct 2013, 02:42 PM
Thanks Alexander, that worked!

The code I ended up using:
.Filter(filter => filter.Add(p => p.myColumn).IsEqualTo(MyEnum.Yes))
Tags
Grid
Asked by
Ermish
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Ermish
Top achievements
Rank 1
Share this question
or