Hello,
I have problem using the event "MouseDoubleClick" on RadTreeViewItem.
It is handled for each branch item and it don't care about e.Handled = true.
Example :
When I double click on "line3.2" I want to obtain only the "Item : line3.2" message but there is "Item : line3" and "Tree" messages too.
Have you any suggestions ?
Thanks,
Guillaume R.
I have problem using the event "MouseDoubleClick" on RadTreeViewItem.
It is handled for each branch item and it don't care about e.Handled = true.
Example :
<telerik:RadTreeView IsDragDropEnabled="True" MouseDoubleClick="treeView_MouseDoubleClick"> |
<telerik:RadTreeView.ItemContainerStyle> |
<Style TargetType="{x:Type telerik:RadTreeViewItem}"> |
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
<Setter Property="IsExpanded" Value="True"/> |
<EventSetter Event="MouseDoubleClick" Handler="treeViewItem_MouseDoubleClick"/> |
</Style> |
</telerik:RadTreeView.ItemContainerStyle> |
<telerik:RadTreeView.ItemTemplate> |
<HierarchicalDataTemplate ItemsSource="{Binding Children}"> |
<Border BorderThickness="1" BorderBrush="LightGray" Margin="2" CornerRadius="5"> |
<Grid> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="Auto"/> |
<ColumnDefinition Width="*"/> |
</Grid.ColumnDefinitions> |
<TextBlock Grid.Column="0" Text="{Binding Key}" Margin="3,0,10,0"/> |
<GridSplitter Grid.Column="0" Width="1" Background="LightGray" ResizeDirection="Columns" dragDrop:RadDragAndDropManager.AllowDrag="True" dragDrop:RadDragAndDropManager.DragQuery="GridSplitter_DragQuery"/> |
<TextBlock Grid.Column="1" Text="{Binding Text}" Margin="3,0,0,0"/> |
</Grid> |
</Border> |
</HierarchicalDataTemplate> |
</telerik:RadTreeView.ItemTemplate> |
<telerik:RadTreeView.Items> |
<local:PairText Key="line1" Text="Some text for line1"/> |
<local:PairText Key="line2" Text="Some text for line2"/> |
<local:PairText Key="line3" Text="Some text for line3"> |
<local:PairText.Children> |
<local:PairText Key="line3.1" Text="Some text for line3.1"/> |
<local:PairText Key="line3.2" Text="Some text for line3.2"/> |
<local:PairText Key="line3.3" Text="Some text for line3.3"/> |
</local:PairText.Children> |
</local:PairText> |
<local:PairText Key="line4" Text="Some text for line4"/> |
<local:PairText Key="line5" Text="Some text for line5"/> |
</telerik:RadTreeView.Items> |
</telerik:RadTreeView> |
private void treeView_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
{ |
MessageBox.Show("Tree"); |
e.Handled = true; |
} |
private void treeViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
{ |
PairText pair = (sender as RadTreeViewItem).Item as PairText; |
MessageBox.Show("Item : " + pair.Key); |
e.Handled = true; |
} |
When I double click on "line3.2" I want to obtain only the "Item : line3.2" message but there is "Item : line3" and "Tree" messages too.
Have you any suggestions ?
Thanks,
Guillaume R.