Hi,
I'm binding a RadListbox to a file structure model (through MVVM and Ria Services).
I want to catch the double click event. As I understand you can get the number of clicks from the leftmousedown or up event.
(e.clickcount).
The leftmousedown event does not fire, and the leftmouseup always return a value of 1.
Is there a different way to catch a double click event?
Anthonie
I'm binding a RadListbox to a file structure model (through MVVM and Ria Services).
I want to catch the double click event. As I understand you can get the number of clicks from the leftmousedown or up event.
(e.clickcount).
The leftmousedown event does not fire, and the leftmouseup always return a value of 1.
Is there a different way to catch a double click event?
Anthonie
5 Answers, 1 is accepted
0
Hello Anthonie,
I will paste the same answer from the other thread.
In SL 5 the click count is available only on mouse down - in mouse up the ClickCount is const 1. I would suggest handling the MouseLeftButtonDown for the RadListBoxItem, not for the RadListBox control. This should do the trick.
Kind regards,
George
the Telerik team
I will paste the same answer from the other thread.
In SL 5 the click count is available only on mouse down - in mouse up the ClickCount is const 1. I would suggest handling the MouseLeftButtonDown for the RadListBoxItem, not for the RadListBox control. This should do the trick.
Kind regards,
George
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Anthonie
Top achievements
Rank 1
answered on 17 Apr 2012, 12:01 PM
Thank you George,
My Listbox's itemsource is binded to a custom List<folders>.
Should I add a Handler to the ListBox.Items?
How would the handler be looking?
I tried:
But the MouseLeftButtonDovenEvent is not a Routed Event.
Any other Ideas?
Anthonie
My Listbox's itemsource is binded to a custom List<folders>.
Should I add a Handler to the ListBox.Items?
How would the handler be looking?
I tried:
this.radListBox1.Items.AddHandler(RadListBox.MouseLeftButtonDownEvent, new EventHandler<System.Windows.Input.MouseButtonEventArgs>(ListItemDoubleClick), true);
But the MouseLeftButtonDovenEvent is not a Routed Event.
Any other Ideas?
Anthonie
0
Hello,
George
the Telerik team
Please, refer to the silverlight forum where you can find more information how to handle mouse click event on list item - http://forums.silverlight.net/t/171651.aspx
Hope this helps.
George
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Lori
Top achievements
Rank 1
answered on 23 Oct 2013, 02:14 PM
Hi George,
I have read the page you provide the link to and I still don't understand how to get the custom behavior associated to the RadListBoxItem when the listbox is bound to a property (collection) in a view model. Can you please provide a more specific example/explanation?
Thanks
Lori
I have read the page you provide the link to and I still don't understand how to get the custom behavior associated to the RadListBoxItem when the listbox is bound to a property (collection) in a view model. Can you please provide a more specific example/explanation?
Thanks
Lori
0
Hi,
A possible approach with which you can access a mouse double click event when clicking and item and is to use the MouseDoubleClick of the RadListBox and inside that event access the SelectedItem. The next code snippet shows how the handler should look like:
Hope this is helpful.
Regards,
Vladi
Telerik
A possible approach with which you can access a mouse double click event when clicking and item and is to use the MouseDoubleClick of the RadListBox and inside that event access the SelectedItem. The next code snippet shows how the handler should look like:
<
telerik:RadListBox
MouseDoubleClick
=
"RadListBox_MouseDoubleClick"
.../>
private
void
RadListBox_MouseDoubleClick(
object
sender, Telerik.Windows.Input.MouseButtonEventArgs e)
{
var listBox = sender
as
RadListBox;
var selectedItem = listBox.SelectedItem;
}
Hope this is helpful.
Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>