How to handle a left mouse button double click event?

6 posts, 1 answers
  1. Rami Abughazaleh
    Rami Abughazaleh avatar
    27 posts
    Member since:
    Feb 2010

    Posted 08 Jun 2010 Link to this post

    Hi.

    I am wondering how to catch a left mouse button double click event and get the TreeListViewItem that was double clicked on?

    Using Telerik Silverlight Controls v2010.1.422.1040



    Thank you.
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 09 Jun 2010 Link to this post

    Hi Rami Abughazaleh,

    The current CTP version of the TreeListView does not have a specific event that can be used. By the end of the week we will release the Q2 beta where you will be able to handle the

    GridViewCell.CellDoubleClick


    routed event.

    Kind regards,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Ivan
    Ivan avatar
    1 posts
    Member since:
    Jul 2010

    Posted 09 Jul 2010 Link to this post

    Dear sir or madam,

    How is it possible to figure out if it is the left or the right button?

    If I make a doubleclick like first leftbutton once then like the doubleclick but the second click on the right mousebutton, then the event is fired as a doubleclick. When I would like to show a contextmenu and click first with left mousebutton to select and quickly the right button for contextmenu, the doubleclick is fired.

    How can I check if the doubleclick is really on left mouse button and not a mix of both?

    Thank you very much
    Best regards.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Jul 2010 Link to this post

    Hi,

     Please use RowActivated event instead. You can check the attached project for reference. 

    Greetings,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Mike
    Mike avatar
    17 posts
    Member since:
    Jul 2010

    Posted 16 Jul 2010 Link to this post

    Thank you Vlad,

    I've upgraded to RadControls for Silverlight 4 2010.2.714 but I am experiencing some unexpected behavior.

    I've modified the previous attachment to reproduce the unexpected behavior as follows:

    private void RadTreeListView_RowActivated(object sender, Telerik.Windows.Controls.GridView.RowEventArgs e)
            {
                Mouse.AddMouseUpHandler(e.Row, RadTreeListView_OnMouseUp, true);
            }

            private void RadTreeListView_OnMouseUp(object sender, Telerik.Windows.Input.MouseButtonEventArgs args)
            {
                if (args.ClickCount == 2)
                {
                    var row = sender as GridViewRow;
                    if (row != null)
                    {
                        MyObject model = row.DataContext as MyObject;

                        MessageBox.Show(model.Name);
                    }
                }
            }

    The problem is that I do not get the message box when I double click within a cell that has data.  But if I click on any white space, it works.

    Any ideas?

    Thank you.
  7. Answer
    Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 22 Jul 2010 Link to this post

    Hi Mike,

    I am attaching a modified version of the project . Please let me know if it does not do the work for you.

    All the best,
    Pavel Pavlov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner