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

Is there an easy way to turn off full row selection highlighting?

4 Answers 76 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 07 Jun 2012, 05:08 PM
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.

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 08 Jun 2012, 07:08 AM
Hello Chris,

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 ?

All the best,
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
Petar Mladenov
Telerik team
answered on 14 Oct 2016, 05:58 AM
Hello Jason,

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}">

 

Tags
TreeView
Asked by
Chris
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Jason D
Top achievements
Rank 1
Veteran
Share this question
or