Detect Click on week number

4 posts, 0 answers
  1. Guillaume
    Guillaume avatar
    1 posts
    Member since:
    Mar 2013

    Posted 22 Mar 2013 Link to this post


    Is it possible, on RadDatePicker control, to handle click event on week number ?

    If so, how to get the clicked week number ?

  2. Vladi
    Vladi avatar
    743 posts

    Posted 27 Mar 2013 Link to this post


    In the current version of RadDatePicker adding click events to the week numbers is not supported.

    You should be able to customize the template of the control and because the week numbers in the control are CalendarButton that inherit ContentControl and you should be able to override its MouseLeftButtonDown and MouseLeftButtonUp events and add a custom logic to them.

    Hope this is helpful.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
  4. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 28 Jan 2015 in reply to Vladi Link to this post

    Could you please give me the sample project that demonstrate week number click in 'RadCalendar' ?. I just enabled the Mouse Click on week number.
  5. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 29 Jan 2015 Link to this post

    Hi All,

    Found a way to resolve 'Week Number' click.
    put this line after 'InitializeComponent();' In your view back end.
    'your rad calendar name'.AddHandler(CalendarButton.MouseLeftButtonDownEvent, new MouseButtonEventHandler(MouseClick),

    Your 'MouseClick' will goes here,
    private void MouseClick(object sender, MouseButtonEventArgs e)
                if (e != null )
                    var ClickOb =
                        (((FrameworkElement) ((e as RoutedEventArgs).OriginalSource)).DataContext) as CalendarButtonContent;
                    if (ClickOb != null && ClickOb.ButtonType == CalendarButtonType.WeekNumber)
                      //Your logic

    Hope this will help !
Back to Top