![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Remove / replace the collapser on a TreeViewItem? Is it possible to remove or replace the collapser button on a TreeViewItem? Ideally I'd like it gone entirely, but otherwise I would style it. I know that the presence of a collapser indicates to the user that there is data "underneath" the node, and usually one wouldn't remove it because it breaks UI cues to not have it, but in my application's case the user isn't supposed to see underlying data unless running in an "advanced" mode. If it isn't possible, can anyone suggest other ways of presenting hierarchial data? Currently I'm using a ListBox and toggling the visiblity of "child" items between Visible and Collapsed, but it feels like a giant hack and isn't proving to be very scalable, performance-wise. |
| | #2 (permalink) |
| Guest | RE: Remove / replace the collapser on a TreeViewItem? I think you can restyle TreeViewItem to achieve this. You can bind collapser.Visibility with TreeViewItem.HasItems property. BooleanToVisibilityConverter can convert the Visiblity to boolean. <Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TreeViewItem}"> <Grid> .... <ToggleButton Visiblity="{Binding HasItems, Converter=..., RelativeSource=....}"/> </Grid> </ControlTemplate TargetType="{x:Type TreeViewItem}"> </Setter.Value> </Setter> </Style> Thanks Bai Shi "Chris Sammis" wrote: > Is it possible to remove or replace the collapser button on a TreeViewItem? > Ideally I'd like it gone entirely, but otherwise I would style it. I know > that the presence of a collapser indicates to the user that there is data > "underneath" the node, and usually one wouldn't remove it because it breaks > UI cues to not have it, but in my application's case the user isn't supposed > to see underlying data unless running in an "advanced" mode. > > If it isn't possible, can anyone suggest other ways of presenting > hierarchial data? Currently I'm using a ListBox and toggling the visiblity > of "child" items between Visible and Collapsed, but it feels like a giant > hack and isn't proving to be very scalable, performance-wise. |
| | #3 (permalink) |
| Guest | RE: Remove / replace the collapser on a TreeViewItem? What I have derived from Bai Shi's post is here: http://pastebin.com/586287 However, if you put that in XamlPad you can see the problem: even explicitly setting IsExpanded to true doesn't show child elements. How can I accomplish that? |
| | #4 (permalink) |
| Guest | RE: Remove / replace the collapser on a TreeViewItem? Hi Chris, I can't find anything from http://pastebin.com/586287 Can you send me a simple repro of you codes? You can send it to cabbagebai@ustc.edu. I think I didn't understand you problem very clearly. Thanks Bai Shi "Chris Sammis" wrote: > What I have derived from Bai Shi's post is here: http://pastebin.com/586287 > > However, if you put that in XamlPad you can see the problem: even > explicitly setting IsExpanded to true doesn't show child elements. How can I > accomplish that? |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| remove vista and replace with XP | stace1 | Vista General | 15 | 02-06-2008 08:20 PM |
| remove Vista/replace XP? | lmo | Vista General | 16 | 11-29-2007 07:19 AM |
| Remove oem and replace with another oem | justthefacts | Vista General | 7 | 08-24-2007 10:44 AM |
| TreeView, TreeViewItem | knallkopf66 | Avalon | 1 | 08-16-2007 08:24 PM |
| How to get the Parent of a TreeViewItem in a treeview when using HierchicalDataTemplate ? | Pon | Avalon | 1 | 04-05-2007 03:16 AM |