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

How to handle a left mouse button double click event?

5 Answers 182 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Rami Abughazaleh
Top achievements
Rank 1
Rami Abughazaleh asked on 09 Jun 2010, 03:05 AM
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.

5 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 09 Jun 2010, 11:37 AM
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.
0
Ivan
Top achievements
Rank 1
answered on 09 Jul 2010, 09:57 AM
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.
0
Vlad
Telerik team
answered on 15 Jul 2010, 08:46 AM
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
0
Mike
Top achievements
Rank 1
answered on 16 Jul 2010, 10:40 PM
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.
0
Accepted
Pavel Pavlov
Telerik team
answered on 22 Jul 2010, 10:06 AM
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
Tags
TreeListView
Asked by
Rami Abughazaleh
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Ivan
Top achievements
Rank 1
Vlad
Telerik team
Mike
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or