Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
How to Bind the IsChecked property to objects IsSelected property
posted

 

 

 

 

 

 

 

 

 

 

 

 

 

I have a simple <ig:HierarchicalDataTemplate> that works. Shown below:

<UserControl.Resources>

 

 

 

<ig:HierarchicalDataTemplate ItemsSource="{Binding Sites}" x:Key="CompanyTemplate">
    <DataTemplate>
       
<TextBlock Text="{Binding company_name}" />
   
</DataTemplate>
   
<ig:HierarchicalDataTemplate.ItemTemplate>
       
<DataTemplate>
           
<TextBlock Text="{Binding site_name}" />
       
</DataTemplate>
   
</ig:HierarchicalDataTemplate.ItemTemplate>
</ig:HierarchicalDataTemplate>
</UserControl.Resources>

CheckBoxes are enabled.  Now I need to Bind the IsChecked property to an IsSelected property of each item.  Is that possible in XAML?  Is it possible in code?  If so, how?  I would prefer to do it in XAML.

 

Parents
No Data
Reply
  • 138253
    Verified Answer
    Offline posted

    Hello,

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want, but instead of XamTree I used a XamDataTree, where the thing you want to achieve is a built-in functionality. Please let me know if this satisfies your needs or you need further assistance on this matter.

    Looking forward for your reply.

    XamDataTreeBinding.zip
Children