HierarchicalDataTemplate with dynamic path

2 posts, 0 answers
  1. TheLostLeaf
    TheLostLeaf avatar
    34 posts
    Member since:
    Feb 2007

    Posted 02 Feb 2010 Link to this post

    Hello.
    I am trying to make the Element field below 'FullName' be a dynamic value that reads from
    {
    Binding Path=Name}.
    Something like this
    <TextBox Text="{Binding Path=Element[{Binding Path=Name}].Value}" Margin="2"></TextBox>
    but it doesnt work.

     

    <UserControl.Resources> 
            <HierarchicalDataTemplate   
                           ItemsSource="{Binding Path=Elements}"   
                x:Key="TVTemplate">  
                <telerik:RadTreeView> 
                    <WrapPanel> 
                        <TextBlock Text="{Binding  Path=Name}" Margin="2"></TextBlock> 
                            <TextBox Text="{Binding  Path=Element[FullName].Value}" Margin="2"></TextBox> 
                        </WrapPanel></telerik:RadTreeView> 
            </HierarchicalDataTemplate> 
        </UserControl.Resources> 

     

  2. TheLostLeaf
    TheLostLeaf avatar
    34 posts
    Member since:
    Feb 2007

    Posted 02 Feb 2010 Link to this post

    Opps, dumb moment.

     

     <telerik:RadTreeView> 
                    <WrapPanel> 
                        <TextBlock Text="{Binding  Path=Name}" Margin="2"></TextBlock> 
                            <TextBox Text="{Binding  Path=Value}" Margin="2"></TextBox> 
                        </WrapPanel> 
    </telerik:RadTreeView> 
    Since it was an XDocument it had a predifined field called Value i was looking for.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top