TreeListView with HierachicalCheckboxes: SubItems are not checked
ObjectListView - ListView on caffeine, guarana and steroids
Brought to you by:
grammarian
Hello.
I have a
TreeListView
with
Checkboxes = true HierachicalCheckboxes = true CanExpandGetter = (working delegate) ChildrenGetter = (working delegate)
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!
(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. WhenHierachicalCheckboxes
is true, the user cannot choose to put a checkbox into a "no value" state, thenTriStateCheckboxes
should be false (which it apparently was).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?
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.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.
Thanks, for me it worked with the ParentGetter.
Fixed in v2.9