RadDatePicker default date

2 posts, 0 answers
  1. Joseph Wong
    Joseph Wong avatar
    10 posts
    Member since:
    Sep 2006

    Posted 22 Oct 2008 Link to this post

    I am using a databound RadDatePicker in a custom edit form of a RadGrid. How do I set the default date to the current date?
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 22 Oct 2008 Link to this post

    Hello Joseph,

    You can access your RadDatePicker using a similar code:
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
        if (e.Item.IsInEditMode && e.Item is GridEditFormItem) 
        { 
            (e.Item.FindControl("RadDatePicker1"as RadDatePicker).SelectedDate = DateTime.Now; 
        } 

    Let me know whether this helps.

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top