gridboundcolumn type field validation

3 posts, 1 answers
  1. Daniel
    Daniel avatar
    16 posts
    Member since:
    Jun 2013

    Posted 28 Jul 2015 Link to this post

    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" 
    <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" />

    <ef:EntityDataSource ID="edsMainGrid" runat="server" 
       OnSelecting="edsMainGrid_Selecting" >


  2. Answer
    Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 31 Jul 2015 Link to this post

    Hi Daniel,

    In this case instead of using GridBoundColumns I would suggest you to use GridDateTimeColumn and GridNumeric column which will generate respectively RadDatePicker and RadNumericTextBox in the filter items.
    I hope this helps.

    Maria Ilieva
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
  4. Daniel
    Daniel avatar
    16 posts
    Member since:
    Jun 2013

    Posted 17 Oct 2015 in reply to Maria Ilieva Link to this post

    Thanks Maria, like a charm.
Back to Top