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

Event triggered when clicking row column in month view

1 Answer 18 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 11 Dec 2014, 06:26 AM
When I am in month view, what event is triggered when I click the text being pointed to in the image below.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 13 Dec 2014, 01:40 PM
Hello Scott,

Thank  you for writing.

Hitting the text as shown in your picture will switch the view to WeekView and the ActiveViewChanging and ActiveViewChanged events will fire. You can detect changes in the view by subscribing to these events. However, the view can be changed by a variety of other actions as well, for example by using the RadSchedulerNavigator.

If you would like to implement your own logic on clicking these cells, then you need to disable the transition from MonthView to WeekView and subscribe to the CellClick event. Please check the code snippet below:
public partial class Form : Form
{
    public Form()
    {
        InitializeComponent();
 
        this.radScheduler.ActiveViewChanged += radScheduler_ActiveViewChanged;
        this.radScheduler.CellClick += radScheduler_CellClick;
    }
 
    private void radScheduler_ActiveViewChanged(object sender, Telerik.WinControls.UI.SchedulerViewChangedEventArgs e)
    {
        if (this.radScheduler.ActiveViewType == SchedulerViewType.Month)
        {
            this.radScheduler.GetMonthView().EnableWeeksHeader = false;
        }
    }
 
    private void radScheduler_CellClick(object sender, Telerik.WinControls.UI.SchedulerCellEventArgs e)
    {
        if (e.CellElement.Parent is MonthViewVerticalHeader)
        {
            MessageBox.Show(e.CellElement.Date.ToString());
        }
    }
}

Hope this helps. Should you have further questions, feel free to ask.

Regards,
Hristo
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler and Reminder
Asked by
Scott
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or