CheckState bindind using ContainerBinding

3 posts, 0 answers
  1. Abdulrahman Omran
    Abdulrahman Omran avatar
    15 posts
    Member since:
    Jan 2011

    Posted 09 May 2011 Link to this post


    I have a treeView on my user interface that consists of 3 levels. The tree is bound to objects which are linked using the HierarchicalDataTemplate.
    Each Object has a property isChecked which is bound to the container's CheckState. This Works great if the user is editing the treeview by checking and unchecking the tree nodes. However, when i load the treeview items from the database i programmatically set the IsChecked property of the 3rd level node either to true or false.

    <telerik:ContainerBindingCollection x:Key="TreeViewItemContainerBindings">   
     <telerik:ContainerBinding PropertyName="CheckState" Binding="{Binding IsChecked, Mode=TwoWay, Converter= {StaticResource
    CheckStateConverter}}" />

    The telerik behaviour when there is a checked child node then the checkbox of the parent will have [-] as it's state and if all of the children checkboxes are checked then parent will be checked likewise.

    This is not being reflected when i programmatically check child nodes. I.e. the parent node's checkbox state doesn't reflect it's children checkstates.

    Am I doing something wrong here ? and if this is the default behaviour is there an event/method that i can execute or raise so that the parent nodes will update their checkstates based on their children nodes?

    Best Regards,

  2. Petar Mladenov
    Petar Mladenov avatar
    3148 posts

    Posted 12 May 2011 Link to this post

    Hi Abdulrahman Omran,

    Could you please examine this detailed blog post and let us know if it helps you ? There is a great sample project at the and of the post and you can use it in order to check whether you are missing something? If it doesn't help you, you can create a support ticket so that you will be able to attach a project demonstrating your problem and we will be better able to assist you. Thank you in advance for your cooperation.

    All the best,
    Petar Mladenov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Abdulrahman Omran
    Abdulrahman Omran avatar
    15 posts
    Member since:
    Jan 2011

    Posted 13 May 2011 Link to this post

    Thank you for your quick response.

    I have read the blog and I do update the checkstate of the treeview items. However, i think the reason behind the issue i described is that i update the objects (IsChecked flag) while the view is hidden and as I understood from the blog this won't propagate the checkstate changes up the tree.

    I will do more testing/modifications if that doesn't solve it, I will raise a support ticket.

    Thank you, Petar.

Back to Top