0

current month current year and start date(1 to be constant) in telerik rad date picker Am working to get date 1= year,6 months back, 1 date2=year, current month, 1

i can get current date as below

    startdatepicker.SelectedDate = DateTime.Now;
//startdatepicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.AddMonths(-6), 1);//-->this not working
GN2271
  • 17
  • 8

2 Answers2

0

This should work, unless I misunderstand your question...

startdatepicker.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

Seano666
  • 2,238
  • 1
  • 15
  • 14
0

I got it by:

DateTime end = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
enddate.SelectedDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

start.SelectedDate = (end.AddMonths(-6));
Peter Hall
  • 53,120
  • 14
  • 139
  • 204
GN2271
  • 17
  • 8