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

How to disable checkbox in treeview programmatically?

3 Answers 170 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Abhishek Gairola
Top achievements
Rank 1
Abhishek Gairola asked on 02 Jul 2010, 12:50 PM
Hello friends

I would like to disable the checkbox in my radtreeview, but currently I do not find any property for this.
If I am wrong please name the property.

If not then please suggest a wayto do it or any alternative options.

I want to disable checkbox on click on a button and then enable them on click of another button.

Thank you!

3 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 07 Jul 2010, 09:30 AM
Hi Abhishek,

There is no straightforward approach to this scenario. You will have to find the CheckBox in the visual tree of the TreeViewItem and disable/enable it. I've prepared a simple solution demonstrating one possible solution to this scenario. Have a look at it and let me know if it helps.

On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverlight applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

Regards,
Kiril Stanoev
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
David Cardona
Top achievements
Rank 1
answered on 17 Feb 2011, 12:12 AM
Hello Kiril.

I have just implemented your example but I have a error in this line

Panel rootPanel = VisualTreeHelper.GetChild(rtvi, 0) as Panel;

The error is: System.ArgumentOutOfRangeException 

Can you help me?


0
Petar Mladenov
Telerik team
answered on 21 Feb 2011, 04:46 PM
Hi David Cardona,

You could  provide a runnable sample and we will try to investigate your issue in depth. Is your tree bound to a collection of objects ? Can you make sure that you are trying to work with a RadTreeViewItem that is already generated ( usually it happens when it is loaded in the tree root level collection or one of its parent item has been expanded so that the needed item becomes visible. You can find more info on this topic here. Thank you for your cooperation in advance.

All the best,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TreeView
Asked by
Abhishek Gairola
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
David Cardona
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or