How do I select all Wednesdays in a radcalendar control?

3 posts, 0 answers
  1. Vithiya
    Vithiya avatar
    41 posts
    Member since:
    May 2008

    Posted 16 Feb 2010 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Feb 2010 Link to this post

    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.
  3. Vithiya
    Vithiya avatar
    41 posts
    Member since:
    May 2008

    Posted 18 Feb 2010 Link to this post

    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
Back to Top