Timeline view & horizontal scroll click

4 posts, 1 answers
  1. MattL
    MattL avatar
    7 posts
    Member since:
    May 2007

    Posted 31 Jan 2012 Link to this post

    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
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 03 Feb 2012 Link to this post

    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).

  3. UI for WinForms is Visual Studio 2017 Ready
  4. MattL
    MattL avatar
    7 posts
    Member since:
    May 2007

    Posted 07 Feb 2012 Link to this post

    Thanks, just what I was after.
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 09 Feb 2012 Link to this post

    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 >>
Back to Top