![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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. |
My System Specs![]() |
| | #2 (permalink) |
| | 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. |
My System Specs![]() |
| | #3 (permalink) |
| | 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? |
My System Specs![]() |
| | #4 (permalink) |
| | 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? |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| remove vista and replace with XP | Vista General | |||
| remove Vista/replace XP? | Vista General | |||
| Remove oem and replace with another oem | Vista General | |||