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

The parent checkbox doesn't get toggled on IsChecked = true

3 Answers 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Dipti
Top achievements
Rank 1
Dipti asked on 05 Mar 2012, 08:24 AM
Hi,

I have a RadTreeView of checkboxes. I have defined HierarchicalDataTemplate and have ContainerBinding of the IsSelected property.

On initialization, when I add countries to the treeview by doing
Country country = new Country() { Name = countryName, IsExpanded = true, IsSelected = true};

 

The country gets checked but the parent node "Region" doesn't get ToggleState.Indeterminate. See attached image. Even when i programmtically set "IsSelected = true" , the country gets checked but it's parent is not.

Though if we directly check the country on UI, the parent node gets ToggleState.Indeterminate state.

This behavior is inconsistent. Please let me know how we can maintain a consistent behavior.
Thanks.

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 06 Mar 2012, 01:30 PM
Hi,

There are many variation of the checkboxes behavior depending on several factors. Could you please elaborate a bit more on your scenario: is the built-in checkbox support enabled or custom checkboxes are used in the data template; is the tri-state mode enabled; are you using data binding to CheckState property.
I assume you are using build-in checkbox support with enabled tri-state mode.

If there is binding to the CheckState property the binding will take precedence. This means that check state values in the view model will override those from tristate mode. Thus you should implement the logic yourself.

If there is no binding could you please specify how are you changing the CheckState. The best approach would be to send us a small sample project simulating the issue (via the ticketing system).

You could take advantage of the support ticketing system (http://www.telerik.com/account/support-tickets/new-support-ticket.aspx) in cases when you need a prompt response to urgent issues. This is the best way to reach our support staff - the support system assigns a response time for all of your questions,
depending on your license and ensures that all questions will reach the respective developers, if needed.

I'm looking forward for your post.

Kind regards,
Hristo
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dipti
Top achievements
Rank 1
answered on 07 Mar 2012, 10:34 AM
I have raised a support ticket - 520044 and have provided a sample.

All the questions that u've asked have been answered in the sample, but still here are few details:

1) I have used the built-in checkboxes.
2) tri-state mode enabled
3) I have done data binding to IsSelected property of checkboxes
4) I have written a logic to check the checkboxes to ToggleState.On and their parent to ToggleState.Indeterminate. But the logic works correctly only when the popup containing the treeview has been opened once. It doesn't work if the popup hasn't been opened even once.

Awaiting a quick reply to my support ticket.

Thanks.
0
Petar Mladenov
Telerik team
answered on 08 Mar 2012, 06:16 PM
Hi Dipti ,

 We replied to your other tickets.

Regards,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TreeView
Asked by
Dipti
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Dipti
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or