HI ,
I have a RadGrid with a column of type GridDateTimeColumn :
| <telerik:RadGrid ID="RadGrid1 > |
| <Columns> |
| <telerik:GridDateTimeColumn DataField="CreationDate" DataType="System.DateTime " /> |
| <Columns> |
| </telerik:RadGrid> |
On this column I have a DateTime picker which allows me to select some date and then I want to apply a filter , for example "GreaterThan" . I am expecting that the result will be all rows with a date CreationDate greater than selected.
In my code I am sending a filter expression generated by a grid to dynamic linq query like this :
| //data is IEnumerable collection of data objects |
| // filter is a filter expression generated by grid , which is converted to string like this : |
| //string filter = string.format("{0}.{1}(\"{2}\")",item.FieldName, item.FilterFunction, item.FieldValue) |
| IQueryable query = data.AsQueryable(); |
| queryquery = query.Where(filter); |
At this point I am getting an exception :
No applicable method 'GreaterThan' exists in dataObjectType 'DateTime'
Is there any way to make it work with dynamic linq ? it will be work with most cases when column type is string, but I need to make it work with INT and DateTime column types .
Any suggestion ? ? ?
Thanks .