asp.netteleriktelerik-raddatepicker

rad date picker should load start date of current month automatically, when Page loads in asp.net


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

Solution

  • 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));