This is a migrated thread and some comments may be shown as answers.

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

1 Answer 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 10 Dec 2014, 07:32 PM
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.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 Dec 2014, 09:48 AM
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 ? 

Regards,
Maya
Telerik
 

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.

 
Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or