In my web app I have a radgrid binded to a EF dbcontext collection.
Issue is that gridboundcolumn don't check for datatype on applying filters and entity query is wrong, for example, If user enters 'some text' on a date filter query is raised as:
"AND (it.lastEditDate = DATETIME'some text')"
and web app crash with "The query syntax is not valid. Near term 'some text', line 6, column 28." The same problem with numeric fields.
What is the right solution for this issue? Thanks!
Code looks like this:
<telerik:RadGrid ID="RadGrid1"
runat="server"
CellSpacing="0"
DataSourceID="edsMainGrid"
....
<telerik:GridBoundColumn FilterControlWidth="50px" ItemStyle-Wrap="false" DataField="lastEditDate"
FilterControlAltText="Filtrar per lastEditDate" HeaderText="lastEditDate" SortExpression="lastEditDate" UniqueName="lastEditDate" ReadOnly="True" DataFormatString="{0:dd/MM/yyyy}">
<ItemStyle Width="50px" />
</telerik:GridBoundColumn>
...
<ef:EntityDataSource ID="edsMainGrid" runat="server"
OnContextCreating="edsMainGrid_ContextCreating"
EntitySetName="myCollection"
OnSelecting="edsMainGrid_Selecting" >
</ef:EntityDataSource>