RadDateTimePicker Calendar

8 posts, 2 answers
  1. Martin
    Martin avatar
    20 posts
    Member since:
    Nov 2010

    Posted 09 Nov 2010 Link to this post

    Hello,

    I am trying to set SpecialDays on the Calendar element within the DateTimePicker but I cannot see how to obtain a reference to the Calendar itself. I see CalendarLocation and CalendarSize but no reference to the actual Calendar, even if I look in the Controls collection.

    Thanks for your help
    Martin
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hi, 

    There is a simple API to set Special days. Please have a look at this documentation which should help. 

    There is also an additional forum post here about removing special days.

    Let me know if you need any more information. 
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Martin
    Martin avatar
    20 posts
    Member since:
    Nov 2010

    Posted 09 Nov 2010 Link to this post

    Thanks for your quick response to my post but I was referring to the DateTimePicker control, there is no way I can see to reference the Calendar within it. If I had a reference to the Calendar then yes, I could set the special days as you suggest.
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Apologies Martin, 

    this link tell you how to get to the calendar element of the RadDateTimePicker. 

    Hope that helps
    Richard
  6. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    And here is an example of setting Special days..

    Private Sub RadDateTimePicker1_Opened(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadDateTimePicker1.Opened
        Dim dtcalendar As RadDateTimePickerCalendar = DirectCast(Me.RadDateTimePicker1.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar)
        Dim calendar As RadCalendar = dtcalendar.Calendar
        calendar.SpecialDays.Add(New RadCalendarDay(New Date(2010, 11, 10)))
    End Sub

    Let me know if you need more help
    richard
  7. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Nov 2010 Link to this post

    Hi Martin,

    How did this go for you? If this has worked for you, please mark as answer so others can find the solution too. If you need more help, just let me know.

    Thanks
    Richard
  8. Matt Low
    Matt Low avatar
    11 posts
    Member since:
    Jun 2008

    Posted 01 Dec 2010 Link to this post

    Richard - Do you happen to know if the samething be accomplished, or is there an equivalent for this, using the ASP.NET AJAX RadDateTimePicker? Please see my post at:  http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatetimepickercalendar-available-for-asp-net-ajax.aspx. Thanks.

    Matt
  9. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 02 Dec 2010 Link to this post

    Hi Matt,

    Sorry, I don't know. I haven't used the ASP.NET controls for some time now. Best to ask in the ASP.NET forum where teh experts for that live.
    Apologies I can't be of more help
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready