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

Hide/Show Checkbox in treeview

10 Answers 645 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Shirya
Top achievements
Rank 1
Shirya asked on 12 Feb 2009, 09:06 PM
Hello,
I would like to know if it is possible to show checkboxes only on one level of the treeview.
For example:
what should i do if I  want to show a checkbox ONLY for the movies category (Sci-Fi, comedy,horror)
    Sci-Fi
         [ ] Movie-Sci-Fi #1
                 Actor #1
                 Actor #2
         [ ] Movie -Sci-Fi #2
               ...
               ...
    Comedy
          [ ] Movie-Comedy #1
                 ...
          [ ] Movie-Comedy #2
                 ....
    Horror
          [ ] Movie-Horror #1

i try to change the ShowCheckBox property of each nodes
    myNode.ShowCheckBox = True
    myNode.ShowCheckBox = false
but doesNt work
thanx
Shirya

10 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 16 Feb 2009, 09:48 AM
Hi Shirya,

Thank you for writing. The answer to your question is yes, however it is done rather awkwardly. It can be done by setting the CheckBoxes properties of the TreeView to true. When you do that, every node in the Tree view will have a checkbox. After this you have to recursively set the ShowCheckBox property to false, for all nodes that do not require a check box.

I hope this idea will be useful. Please write back if you have other questions.

Greetings,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Shirya
Top achievements
Rank 1
answered on 17 Feb 2009, 02:56 PM
thanks.
0
Daniel
Top achievements
Rank 1
answered on 10 Jun 2009, 10:54 AM
Hello,

I set the ShowCheckBox property to false, but the node still shows a CheckBox, what is wrong?

RadControl Version 8.1.0.0
0
Victor
Telerik team
answered on 10 Jun 2009, 11:34 AM
Hello Daniel,

Thank you for your question. This can only happen if you set ShowCheckBox property of the node to false before you set the CheckBoxes property of RadTreeView to true, at least as far as we know. Please provide more details if this is not your case. I am looking forward to your reply.

Regards,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Daniel
Top achievements
Rank 1
answered on 10 Jun 2009, 11:39 AM
I now solved it:
RadTreeNode myNode = new RadTreeNode("DESCRIPTION"); 
                 
myTreeView.Nodes.Add(myNode); 
 
myNode.ShowCheckBox = false
0
Grant Drury-Green
Top achievements
Rank 1
answered on 25 Mar 2010, 03:10 AM
Just to clarify this - it seems that the ShowCheckBox property of a TreeNode is only honoured AFTER it has been added to the TreeView's nodes collection.

This seems like a bug to me...
0
Victor
Telerik team
answered on 25 Mar 2010, 06:46 PM
Hi Grant Drury-Green,

This is not a bug but the natural order of the normal .NET property settings. If you set the ShowCheckBox property of a node before you add it to the tree view, when you add it, the tree view will overwrite the setting that is already there. For historical reasons ShowCheckBox is a normal property and not a RadProperty; if it was a RadProperty it would respect certain priority rules.

Write again if you need assistance with any other issues.

All the best,
Victor
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
Dina
Top achievements
Rank 1
answered on 15 May 2017, 06:19 PM
Do you have ShowCheckBox analog for Core version? There is no such property
0
Stefan
Telerik team
answered on 16 May 2017, 10:32 AM
Hi Dima,

The following example shows this: Creating tree nodes with checkboxes | ASP.NET MVC TreeView Demo.

Please note that this is the WinForms forum and if you have any further question please post them here: UI for ASP.NET Core Forums - Telerik Community.

I hope this will be useful. 

Kind regards,
Stefan
the Telerik team
 
 
0
Dina
Top achievements
Rank 1
answered on 16 May 2017, 10:41 AM

unfortunately wasn't

ok

Tags
Treeview
Asked by
Shirya
Top achievements
Rank 1
Answers by
Victor
Telerik team
Shirya
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
Grant Drury-Green
Top achievements
Rank 1
Dina
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or