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

Value of '1/1/1754 12:00:00 AM' is not valid for 'SelectedDate'

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 12 Feb 2009, 02:02 PM
Hello,

I get this error when switch in edit mode for my grid.
The column causing this is a GridDateTimeColumn which has display='false' in grid declaration.
And it displays correctly when in non edit mode.
??

Last RadControls version, IE7.
Seems a bug ?

CS

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 16 Feb 2009, 04:59 PM
Hi Christian,

I suspect that the error stems from the fact that the default MinValue setting for date picker in the GridDateTimeColumn is equal to SQL smalldatetime min value. Does changing the min value for the date picker editor programmatically inside the ItemCreated handler of the grid as follows:

private void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)  
{  
 if(e.Item is GridEditableItem && e.Item.IsInEditMode)  
 {  
   ((e.Item as GridEditableItem)["<My_DateTimeColumn_UniqueName>"].Controls[0] as RadDatePicker).MinDate = "01/01/1700";  
 }   

addresses the error in question? Let us know whether this helps.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Share this question
or