The problem that we're having is that we have context menus for individual tree items and a context menu for the tree itself.
A right-click on the empty highlighted area next to a selected item in the tree brings up the tree view context menu instead of the item context menu, which is a bit confusing to the user.
We'd prefer to be able to have the selection highlight only cover the actual item contents, not the empty space to the right of the item.
A right-click on the empty highlighted area next to a selected item in the tree brings up the tree view context menu instead of the item context menu, which is a bit confusing to the user.
We'd prefer to be able to have the selection highlight only cover the actual item contents, not the empty space to the right of the item.
4 Answers, 1 is accepted
0
Hello Chris,
Petar Mladenov
the Telerik team
The ContextMenu of RadTreeViewItem opens when the Mouse is over the item's Header. It does not rely on the dashed selection rectangle's position. The way to configure this is to use the HorizontalHeaderAlignment property. For example, if it is set to Stretch the ContextMenu will open when you right click almost everywhere on the RadTreeViewItem.
However, we think that having a two ContextMenus - one for the item and one for the tree might be confusing too. What kind of settings/operations do you need to support in the menus ?
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Jason D
Top achievements
Rank 1
Veteran
answered on 13 Oct 2016, 06:31 PM
How do you set HorizontalHeaderAlignment? It's not a property of the TreeView.
0
Hello Jason,
This was a mistake. The correct property you need to set is HorizontalContentAlignment of the RadTreeViewItem. You can set it via style.
Regards,
Petar Mladenov
Telerik by Progress
This was a mistake. The correct property you need to set is HorizontalContentAlignment of the RadTreeViewItem. You can set it via style.
<
telerik:RadTreeView
>
<
telerik:RadTreeView.ItemContainerStyle
>
<
Style
TargetType
=
"telerik:RadTreeViewItem"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Stretch"
/>
</
Style
>
</
telerik:RadTreeView.ItemContainerStyle
>
Regards,
Petar Mladenov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Jason D
Top achievements
Rank 1
Veteran
answered on 14 Oct 2016, 07:58 PM
Thank you, that worked. I did need to change it to:
<
Style
TargetType
=
"telerik:RadTreeViewItem"
BasedOn
=
"{StaticResource RadTreeViewItemStyle}"
>