asked on 13 Oct 2021, 05:06 PM
| edited on 13 Oct 2021, 05:06 PM
Hello, I'm trying to add a date filter to a dynamic column but my filter it's not applied, always apply the default string filter.
This is my current code to create the grid:
And this is current result:
Is there any way to implement this(date filter in dynamic grid)?
BR, Miguel Machado
1 Answer, 1 is accepted
answered on 18 Oct 2021, 07:26 AM
In general, when the grid is bound to a dynamic, the data types that are different from the string data type should be declared additionally in the model of the data source. For instance:
foreach (System.Data.DataColumn column in Model.Columns)
var field = model.Field(column.ColumnName, column.DataType);
If you know the specific field name, you can go ahead and specify it in the model as of type DateTime. This way, the column will be treated as a date column and the filter menu will render date pickers out of the box.
Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.