Menu

#150 TreeListView with HierachicalCheckboxes: SubItems are not checked

C#_v2.8.1
closed
None
1
2015-11-07
2015-07-29
No

Hello.

I have a

TreeListView

with

Checkboxes = true
HierachicalCheckboxes = true
CanExpandGetter = (working delegate)
ChildrenGetter = (working delegate)
  • The data for the tree has three levels
  • The TreeListView is complety collaps

Cases:
1.) I check the root element: Only the root element is in the collection CheckedObjects.

2.) I check the root element, after this, i expand the node: now the sub items are checked an i find them in the collection CheckedObjects

3.) I set an item from the last (5th) level over the collection: If i expand the way to this item, the item is checked, but the TriStateCheckboxes are not set.

I hope i have explain it enough.

Greetings. And is a great work!

Discussion

  • Phillip Piper

    Phillip Piper - 2015-07-29

    (1) and (2) are the expected behaviour. See this: http://objectlistview.sourceforge.net/cs/blog7.html#hierarchy-and-checkedobjects

    Not sure what you mean by (3). TriStateCheckboxes is a setting on ObjectListView to indicate whether checkboxes should be able to put into a "no value" state by the user. When HierachicalCheckboxes is true, the user cannot choose to put a checkbox into a "no value" state, then TriStateCheckboxes should be false (which it apparently was).

     
  • Patrick le Mestrez

    In (3) it is the same problem. The object are not revaled. But i set in .CheckedObjects an object from the last level ("STEU001"), see attatchment. i want in the collapsed start, that the higher levels vom "STEU001" are set to the correct values (checked, not checked or no value)

    I do a workaround:

    1.) ExpandAll
    2.) Set .CheckedObject
    3.) CollapseAll

    I thought, that with HierachicalCheckboxes this handling should be the default, to revalve all items at first?

     
  • Phillip Piper

    Phillip Piper - 2015-08-01

    Thank you for the screen shot. That made it easier to understand the issue.

    Almost certainly, you need to install a ParentGetter delegate. You need this if you set the checkedness of a deeply nested object that has never been revealed. ObjectListView uses this delegate to calculate the ancestors of objects it has never seen before.

     
  • Phillip Piper

    Phillip Piper - 2015-08-02

    Actually, I can see a bug in the code that could prevent this from working.

    I'll make sure it is fixed before 2.9 is released.

     
  • Patrick le Mestrez

    Thanks, for me it worked with the ParentGetter.

     
  • Phillip Piper

    Phillip Piper - 2015-11-01
    • status: open --> accepted
    • assigned_to: Phillip Piper
     
  • Phillip Piper

    Phillip Piper - 2015-11-07
    • status: accepted --> closed
     
  • Phillip Piper

    Phillip Piper - 2015-11-07

    Fixed in v2.9

     

Log in to post a comment.