Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8650295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:47:03+00:00 2026-06-12T13:47:03+00:00

I am attempting to modify a TreeView to display the TreeViewItem values above and

  • 0

I am attempting to modify a TreeView to display the TreeViewItem values above and below their child items, such that:

foo
|bar
||baz
|biz

would become

foo
|bar
||baz
| baz
|bar
|biz
 biz
foo

A trimmed representation of the current control template is provided below, provided with no guarantee that this snippet compiles:

<ControlTemplate TargetType="{x:Type TreeViewItem}">
  <Grid>
     <Grid.ColumnDefinitions>
        <ColumnDefinition MinWidth="19"
                          Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <ToggleButton x:Name="Expander"
                    IsChecked="{Binding Path=IsExpanded,
                    RelativeSource={RelativeSource TemplatedParent}}"
                    ClickMode="Press"/>
      <Border Name="Bd"
              Grid.Column="1"
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Padding="{TemplateBinding Padding}">
        <ContentPresenter x:Name="PART_Header"
                          ContentSource="Header"
                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
      </Border>
      <ItemsPresenter x:Name="ItemsHost"
                      Grid.Row="1"
                      Grid.Column="1"
                      Grid.ColumnSpan="2"/>
      <TextBlock Text="Some Binding Goes Here"
                 Grid.Row="2"
                 Grid.Column="1"
                 Grid.ColumnSpan="2"/>
    </Grid>
  </ControlTemplate>

The repeated entries would not have children, it would just be the display value. Thus far I can modify the TreeView ContainerStyle using a ControlTemplate to insert a TextBlock at the appropriate place in the visual tree. What data binding should be used in order to fetch the appropriate display value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:47:04+00:00Added an answer on June 12, 2026 at 1:47 pm

    Why not use a ContentPresenter again?

    <ContentPresenter ContentSource="Header"
                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                      Grid.Row="2"
                      Grid.Column="1"
                      Grid.ColumnSpan="2"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting the modify this Modx Snippet so that it will accept multiple values
I'm attempting to modify a MIPS simulator to display the contents of its registers
I've been attempting to modify the contents of a custom tree view that inherits
I am attempting to use Beautiful Stone Soup (BSS) to modify existing XML that
I've been attempting to modify some code that I was using previously with jQuery
I'm attempting to modify a mySQL query (that works) to return a more specific
I'm attempting to modify an applescript that fires a growl notification when there is
I'm attempting to modify a quicksort algorithm, and implement a pivot that is a
I'm attempting to modify an inherited project that has a convoluted process of displaying
I'm attempting to recompile the Launcher2 (Gingerbread) application, so that i can modify it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.