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

How do I select all Wednesdays in a radcalendar control?

2 Answers 28 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Vithiya
Top achievements
Rank 1
Vithiya asked on 16 Feb 2010, 10:18 PM
I am using a radcalendar control with multi selection and userowheaderstoselectrows enabled. It works fine. But I have a requirement to select all wednesdays within a certain date range. Is there a built in mechanism available in the radcalendar that will let me do that? If not and if I end up writing custom code to accomplish that, how do I select multiple dates on server side?

Thank you,
Vithiya

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 17 Feb 2010, 06:14 AM
Hello Vithiya,

One suggestion is getting all the Wednesdays in the date range and adding the date value to SelectedDates collection. Here is the example of how the date can be added to SelectedDates collections.

CS:
 
     DateTime MyDate = DateTime.Now.Date; 
     if (MyDate.DayOfWeek == DayOfWeek.Wednesday) 
     { 
          RadDate dt = new RadDate(MyDate); 
          RadCalendar1.SelectedDates.Add(dt); 
     } 

-Shinu.
0
Vithiya
Top achievements
Rank 1
answered on 18 Feb 2010, 07:44 PM
Thank you Shinu. That was very helpful!

Now I have another question.

When I click on the column header of the radcalendar, it selects all items in that column. Can I intercept that event on server side? Here is what I am trying to do.When the user clicks on the wednesday column header, I want to select all wednesdays from that day forward.

Thank you,
Vithiya
Tags
Calendar
Asked by
Vithiya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Vithiya
Top achievements
Rank 1
Share this question
or