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

RadDatePicker default date

1 Answer 275 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Joseph Wong
Top achievements
Rank 1
Joseph Wong asked on 22 Oct 2008, 01:44 PM
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?

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Oct 2008, 03:04 PM
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.
Tags
Calendar
Asked by
Joseph Wong
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or