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

Timeline view & horizontal scroll click

3 Answers 116 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
MattL
Top achievements
Rank 1
MattL asked on 31 Jan 2012, 10:48 PM
I need to detect if the user has clicked the horizontal scrollbar rather than an appointment, cell element, RadSchedulerNavigator or the RadCalendar associated with the RadScheduler.

Have not been able to work out how to attach to the event.

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 03 Feb 2012, 12:47 PM
Hi Matt,

Thank you for writing.

You can detect which element you have clicked by subscribing to the MouseDown event of the control and check the clicked element type. Here is a sample demonstrating how to check if the scroll bar, its buttons or its thumb is clicked:
void radScheduler1_MouseDown(object sender, MouseEventArgs e)
{
    ScrollBarThumb thumb = radScheduler1.ElementTree.GetElementAtPoint(e.Location) as ScrollBarThumb;
    if (thumb != null)
    {
        //thumb is clicked
    }
 
    ScrollBarButton btn = radScheduler1.ElementTree.GetElementAtPoint(e.Location) as ScrollBarButton;
    if (btn != null)
    {
        //scroll btn is clicked
    }
 
    RadScrollBarElement scroll = radScheduler1.ElementTree.GetElementAtPoint(e.Location) as RadScrollBarElement;
    if (scroll != null)
    {
        //scroll is clicked
    }
}

I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
 
Greetings,
Stefan
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

0
MattL
Top achievements
Rank 1
answered on 07 Feb 2012, 09:37 AM
Thanks, just what I was after.
0
Stefan
Telerik team
answered on 09 Feb 2012, 12:07 PM
Hello Matt,

I am glad that I could help. Do not hesitate to contact us if you have any other questions.

Greetings,
Stefan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Scheduler and Reminder
Asked by
MattL
Top achievements
Rank 1
Answers by
Stefan
Telerik team
MattL
Top achievements
Rank 1
Share this question
or