When the Grid goes into Edit mode with a GridDateTime column with picker, if the column is NULL (a valid value in the db in this case) I get an exception.
This is bound to a LINQ datasource, is there any way to handle this exception or cause a default value to appear?
This is bound to a LINQ datasource, is there any way to handle this exception or cause a default value to appear?
3 Answers, 1 is accepted
0
Hello Rob,
Can you provide a bit more info about this exception (full stack trace)?
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Can you provide a bit more info about this exception (full stack trace)?
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Rob
Top achievements
Rank 1
answered on 07 May 2008, 06:43 PM
Here is the error and stack trace below. Note that the field is a SQL2005 datetime field that is null. If I put a valid datetime in the field, it works fine so the exception only happens when the field is null, and only if the column is datetime column as listed below:
<telerik:GridDateTimeColumn UniqueName="PlanDocsInServiceDate" PickerType="DateTimePicker" HeaderText="PlanDocsInServiceDate" Visible="false" DataField="PlanDocsInServiceDate">
</telerik:GridDateTimeColumn>
ERROR:
String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.FormatException: String was not recognized as a valid DateTime.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434
0
Hi Rob,
Unfortunately I was unable to reproduce this unwanted behavior locally. Can you please double check that the DataField property is pointing to a valid field name? I attached a simple project that tries to re-create the described issue, can you please modify it as the error to appear and send it back to us (attached to a formal ticket)? Thus we will do everything possible to give you an accurate resolution.
Best wishes,
Rosen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Unfortunately I was unable to reproduce this unwanted behavior locally. Can you please double check that the DataField property is pointing to a valid field name? I attached a simple project that tries to re-create the described issue, can you please modify it as the error to appear and send it back to us (attached to a formal ticket)? Thus we will do everything possible to give you an accurate resolution.
Best wishes,
Rosen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
