TreeView style to support full-row select

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 8 years ago by Eric P
Version: 15.1.0623
Avatar

So we very much like the Actipro Styles that apply to native controls like a TreeView but the out-of-the-box style for a TreeView (and the Actipro style for a TreeView) does not support a full-row selection like the TreeView used in Visual Studio Solution Explorer. I understand how to create a TreeView style that supports a full-row selection but I am not sure how to base it on the Actipro Style for a TreeView. I am familar with the BasedOn attribute for a Style (which is also mentioned in this post http://www.actiprosoftware.com/community/thread/6314/preserving-theme-on-treeviewitem-with-itemcon). The issue is that to support a full-row selection in a TreeView you have to modify the Template of the TreeViewItem.

<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource {x:Static themes:SharedResourceKeys.TreeViewItemStyleKey}}">
  <Setter Property"Template">
    <Setter.Value>

    </Setter.Value>
  </Setter>
</Style>

Even if I base my style on the Actipro style for a TreeViewItem I am replacing your Template with mine and then I do not get all of the nice mouse over (hover) effects that I really like. I believe that the answer would be to first start with the Actipro Style for a TreeViewItem and then modify its Template to support a full-row selection. Right?

Thanks,

   -eric

Comments (2)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Eric,

That is correct, you'd want to clone our Style/Template for TreeViewItem and use that as a starting point so that you can modify it as needed, while retaining all of our theming that is built into our Template..


Actipro Software Support

Posted 8 years ago by Eric P
Avatar

Great thanks! FYI having full-row selection for a TreeView when using the Metro themes would be a nice addition BTW. :-)

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.