Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > How to correctly catch a double click event on an item

Answered How to correctly catch a double click event on an item

Feed from this thread
  • Franco avatar

    Posted on Feb 23, 2011 (permalink)

    Good morning.
    I'm studying your demos for RadCarousel, in particular the "First Look" one, and I want to intercept the double click event on an item. I don't know how to do it, as the item hasn't the double click event wired to it. How can I solve this problem?

    Thank you

    Gianfranco Pesenato

    Reply

  • Answer Ivan Todorov Ivan Todorov admin's avatar

    Posted on Feb 25, 2011 (permalink)

    Hello Franco,

    Thank you for writing.

    Please have a look at the radCarousel1_ItemDataBound() method. This is where the visual items are created. You should subscribe to the carouselItem's events, but since the animation starts on the first click, the double click event is never fired. Therefore, I suggest using the MouseDown event and check the number of clicks. Here is a sample code:
    private void radCarousel1_ItemDataBound(object sender, ItemDataBoundEventArgs e)
    {
        RadButtonElement carouselItem = (RadButtonElement)e.DataBoundItem;
        carouselItem.MouseDown += new MouseEventHandler(carouselItem_MouseDown);
        // ... Other initializations
    }
     
    void carouselItem_MouseDown(object sender, MouseEventArgs e)
    {
        if (e.Clicks > 1)
        {
            MessageBox.Show("Double click");
        }
    }

    I hope this will help you. Feel free to write back if you have any other question.

    Greetings,
    Ivan Todorov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > How to correctly catch a double click event on an item
Related resources for "How to correctly catch a double click event on an item"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]