Nullable Datetime Column & Binding/Validation Error with editing empty column

2 posts, 0 answers
  1. James
    James avatar
    5 posts
    Member since:
    Jan 2013

    Posted 10 Dec 2014 Link to this post

    I've got a Nullable Datetime GridViewDataColumn, and if I follow the following steps I'm getting a validation/binding error:

    1)  Start with a blank column
    2)  Double-click the column to activate editing but don't type anything, or if you type anything, delete it.
    3)  Click on any other part of the grid

    Validation Error:  Object of type System.String cannot be converted to System.Nullable [System.DateTime]

    If I start with a column that has data in it and delete it, things work fine.  But if I start to edit an empty field and try to leave it while it is still empty, I get this error.
    Once the error is up, you can't seem to do anything on the grid until you hit the ESC key, which is confusing our users.

    Is something I can do so that leaving the column while it is still empty will be validated properly?  This shouldn't be creating a validation problem with a Nullable DateTime.

  2. Maya
    Maya avatar
    4062 posts

    Posted 12 Dec 2014 Link to this post

    Hello James,

    I tried to reproduce the issue, but without any success. Could you take a look at the sample attached to verify whether I am missing anything ? 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top