Skip to content

Commit 47817db

Browse files
ES-975464 -
1 parent c0f5a7b commit 47817db

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# How to prevent the selection while pressing right click in wpf and uwp treegrid?
2-
This example illustrates how to prevent the selection while pressing right click in wpf and uwp treegrid
2+
3+
This example illustrates how to prevent the selection while pressing right click in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) and [UWP TreeGrid](https://www.syncfusion.com/uwp-ui-controls/treegrid).
4+
5+
You can prevent the selection when right-clicking in `TreeGrid` by customizing the [SelectionController](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_SelectionController) and overriding the [ProcessPointerPressed](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridRowSelectionController.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridRowSelectionController_ProcessPointerPressed_System_Windows_Input_MouseButtonEventArgs_Syncfusion_UI_Xaml_ScrollAxis_RowColumnIndex_).
6+
7+
``` c#
8+
protected override void ProcessPointerPressed(MouseButtonEventArgs args, RowColumnIndex rowColumnIndex)
9+
{
10+
if (args.ChangedButton == MouseButton.Right)
11+
{
12+
args.Handled = true;
13+
}
14+
else
15+
base.ProcessPointerPressed(args, rowColumnIndex);
16+
}
17+
```

0 commit comments

Comments
 (0)