This is a migrated thread and some comments may be shown as answers.

Refreshing Checkbox state

3 Answers 39 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
David Brubacher
Top achievements
Rank 1
David Brubacher asked on 19 Mar 2010, 03:27 PM
When I populate a list with some child elements checked and others not, how do I refresh the state of the checkbox on the parent without expanding the checkbox?

In the attached images, Populated is what I see immediately after the list is populated and Expanded is what I see when I expand the first item. The checkbox beside the parent now shows the correct tri-state symbology.

3 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 23 Mar 2010, 03:46 PM
Hi David,

The reason why the CheckState of a parent item is not updated until it's expanded is that the containers for its children are not yet generated. The way to work around this is to get a reference to the container of the parent item that you add children to and manually set its CheckState to the appropriate value, depeneding on the states of the children. Let me know if you need help with that.

Kind regards,
Tihomir Petkov
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.
0
Dave Brubacher
Top achievements
Rank 2
answered on 24 Mar 2010, 03:00 PM
I don't have that many items and have other reasons to force all child containers to be generated. That should do it too right?
0
Tihomir Petkov
Telerik team
answered on 25 Mar 2010, 02:40 PM
Hello Dave,

Yes, if the containers for the child items are generated/rendered, then the CheckState of the parent item should be updated correctly.

Regards,
Tihomir Petkov
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.
Tags
TreeView
Asked by
David Brubacher
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Dave Brubacher
Top achievements
Rank 2
Share this question
or