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

Detect Click on week number

3 Answers 116 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 22 Mar 2013, 10:36 AM
Hi,

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

If so, how to get the clicked week number ?

Thanks

3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 27 Mar 2013, 12:49 PM
Hi,

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,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
saw
Top achievements
Rank 1
answered on 28 Jan 2015, 09:11 AM
Hi,
Could you please give me the sample project that demonstrate week number click in 'RadCalendar' ?. I just enabled the Mouse Click on week number.
0
saw
Top achievements
Rank 1
answered on 30 Jan 2015, 04:27 AM
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),
               true);

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 !
Tags
DatePicker
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Vladi
Telerik team
saw
Top achievements
Rank 1
Share this question
or