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 8464881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:53:01+00:00 2026-06-10T14:53:01+00:00

I am using a telerik TreeView in WPF, and I’m using a HierarchicalDataTemplate to

  • 0

I am using a telerik TreeView in WPF, and I’m using a HierarchicalDataTemplate to show the nodes. Nodes represent matched items – which can be left only, right only, equal or inequal (a tree based comparison).

I am currently using a DataTemplateSelector to select from one of four templates, which all look similar to the following:

    <HierarchicalDataTemplate x:Key="EqualTreeItemTemplate" ItemsSource="{Binding}">
        <Grid Name="rowGrid" HorizontalAlignment="Stretch" Height="Auto" d:DataContext="{d:DesignInstance Carbon:ICarbonComparisonPair }">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="16" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Path Data="F1M574.042,314.611L533.8,344.398 522.251,328.798 515.235,333.988 526.786,349.593 526.782,349.596 531.978,356.603 579.235,321.622 574.042,314.611z" Stretch="Uniform" Fill="#FF000000" Width="16" Height="16" VerticalAlignment="Center" Margin="0,0,0,0" />
            <TextBlock Grid.Column="1" Text="{Binding ObjectName}" Style="{StaticResource ObjectNameStyle}" Margin="4,0,0,0" />
            <TextBlock Grid.Column="2" Text="{Binding ObjectName}" Style="{StaticResource ObjectNameStyle}" Margin="4,0,0,0" />
        </Grid>
    </HierarchicalDataTemplate>

The problem that I have is that the item content area is a different width based on the level of the tree that the item appears in. This means that the columns that I have don’t line up – the text in the right hand column shifts to the right a bit for each level of the tree that you expand.

What I would like to do is specify the right hand grid column’s width to be 50% of the size of the tree control as a whole, rather than 50% of the grid’s natural area. I thought maybe I could do this with a binding with a RelativeSource, but I just can’t seem to make it work. Is there a way to achieve this in XAML, or do I need to resort to code-behind?

  • 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-10T14:53:03+00:00Added an answer on June 10, 2026 at 2:53 pm

    If I’m understanding it correctly you want column index 2 to align across all items?

    Check out the TreeListView control and see if that gives you what you need.

    Silverlight demo here (just so you can see what it looks like – the WPF version is pretty much the same)

    [Edit – More info]
    The SharedGroupName property on ColumnDefinition is tempting but, thanks to the indent, it won’t quite work – you’ll end up with all of the content in column 1 or 2 being sized the same, but the pesky indent still throws it off. Check out ListView’s View Property. I’m believe it’s at least in the same spirit as what Telerik TreeListView is, if not darned similar in implementation.

    Here’s a decent writeup on how to use it. (Ironically I have that page bookmarked in a folder called “TreeGridList” so apparently at some point I had the idea to do that to accomplish something similar 🙂 )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following script to make a treeview: <% Html.Telerik().TreeView() .Name(TreeView) .Items(treeview
I am using Telerik treeview in MVC3 Razor view to display tree structured information.
I am using Telerik's RadDatePicker control which i think is essentially a DateTime control
Hai am using telerik wpf grid in grid selection change event am getting the
I am using Telerik Rad tabstrip control in which I am loading two user
I am using Telerik MVC grid ajax binding to show some records. While the
I am using Telerik asp.net mvc extensions. I have an issue that happens only
I am using Telerik tree view control: http://demos.telerik.com/aspnet-mvc/treeview http://demos.telerik.com/aspnet-mvc/treeview/clientsideevents What I want to do
Currently i am using Telerik grid which filters are applied to each column. I
I am using this code in my view: @(Html.Telerik().TreeView() .Name(AjaxTreeView) .BindTo(Model, (item, category) =>

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.