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

How to Set Default Year in DatePicker

1 Answer 96 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ravi Kumar
Top achievements
Rank 1
Ravi Kumar asked on 02 Aug 2010, 11:02 AM
Hi

I,m using raddatepicker. but i want to set default year like "current month 1990".

Regards
Ravi

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Aug 2010, 11:48 AM
Hi,

Here is the code snippet to get required result.

C#:
protected void Page_Load(object sender, EventArgs e)
{
    // Set default value for DatePicker
    DateTime dt = new DateTime(1990, DateTime.Now.Month, DateTime.Now.Day);
    RadDatePicker2.FocusedDate = dt;
}


Thanks,
Princy.
Tags
Calendar
Asked by
Ravi Kumar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or