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

2 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 12 Feb 2009 Link to this post


    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 ?

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 16 Feb 2009 Link to this post

    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,
    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.
Back to Top