TreeView with LoadOnDemand and checkboxes does not remember checkbox state

2 posts, 1 answers
  1. Mike
    Mike avatar
    17 posts
    Member since:
    Jul 2010

    Posted 13 Aug 2010 Link to this post

    Hi.

    I took the example from .\Demos\Examples\TreeView\LoadOnDemand and just set IsOptionElementsEnabled="True" on the RadTreeView.

    Then when I run the project, checkmark Beverages, and then expand it, the checkmark on Beverages disappears.

    Is this a bug?

    Any ideas to work-around this?

    Thank you.

    RadControls_for_Silverlight_4_2010_2_0812
  2. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 18 Aug 2010 Link to this post

    Hi Mike,

    Yes this is a bug. i gave you 1000 points for your efforts.

    The problem comes from the fact that children elements in the view model are stored inside a ObservableCollection. If you change the type to be List for example and make the necessary changes the bug should not be introduced.

    However I'm attaching a project with the work around that does not depend of whether ObservableCollection or List is used. The solution is based on data binding. This way the value is preserved during expand. Note I'm implementing the INotifyPropertyChanged interface in order to employ two way binding.

    All the best,
    Hristo Milyakov
    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
Back to Top