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

[Solved] Filter using reflection

0 Answers 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gabriel
Top achievements
Rank 1
Gabriel asked on 31 Oct 2010, 02:10 AM
I want built filters in runtime. (Server -side code).
I need do something how this:
Html.Telerik()
.Grid(Model)
.Name("MyGrid")
.Filterable
(filtering => filtering.Filters
        (filter =>
            {
                if (filterCollection != null)
                {
                          foreach(FilterObject  filtercondition in filterCollection)
                            filter.Add (o => o.GetType().GetProperty( filtercondition.FieldName).GetValue(o, null) ).IsEqualTo( filtercondition.Value);
                     
                }
             }
         )
);


This code isn't working.  Can you help me?
Many thanks.
Tags
Grid
Asked by
Gabriel
Top achievements
Rank 1
Share this question
or