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

Radiobuttons not working together

4 Answers 118 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Marek
Top achievements
Rank 1
Marek asked on 11 Jan 2008, 12:28 AM
Hi
I have placed a RadTreeView on a form and then in the load event have the following:

            for (int i = 0; i < 10; i++)  
            {  
                RadTreeNode treeNode = new RadTreeNode(i.ToString());  
                treeNode.ShowRadioButton = true;  
 
                radTreeView1.Nodes.Add(treeNode);  
            }  
 

The problem is that when I click on one item in the list and then another, the first one is not deselected and I end up with all the radio buttons selected.  The sample you provide does not have this problem.

Please could you explain how to achieve the effect I want - a list of (top level) radio buttons.

Thanks

Best regards

Marek

4 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 11 Jan 2008, 02:14 PM
Hello Marek,

Thank you for contacting us.

Please try the following:

this.radTreeView1.CheckBoxes = true;  
      
            for (int i = 0; i < 10; i++)  
            {  
                RadTreeNode treeNode = new RadTreeNode(i.ToString());  
                treeNode.ShowRadioButton = true;  
 
                radTreeView1.Nodes.Add(treeNode);  
            }   

However, you will need to set the ShowCheckBox property to false to the tree nodes.

Write me back if you have additional questions.

Regards,
Boyko Markov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Marek
Top achievements
Rank 1
answered on 11 Jan 2008, 02:26 PM
Hi
I'm afraid that by setting the tree property to checkboxes, the nodes are only ever checkboxes, no matter what properties I set on the nodes themselves.

The code you suggested (with an addition) still does not achieve the desired result.  I have tried setting the check box and radio button properties in the reverse order and that has not effect either.

            this.radTreeView1.CheckBoxes = true;  
 
            for (int i = 0; i < 10; i++)  
            {  
                RadTreeNode treeNode = new RadTreeNode(i.ToString());  
 
                treeNode.ShowCheckBox = false;  
                treeNode.ShowRadioButton = true;  
 
                radTreeView1.Nodes.Add(treeNode);  
            }  
 


Best regards

Marek
0
Boyko Markov
Telerik team
answered on 11 Jan 2008, 04:13 PM
Hello Marek,

I'm sending you a movie about how this behavior is working in my computer with the latest installed version of RadControls for WinForms. Please watch this movie and tell me if I'm missing something. 

Could you please send me a project replicating the specific behaviour you're describing. It'll help us reproduce the issue locally.

Regards,
Boyko Markov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stefan
Telerik team
answered on 21 Mar 2011, 10:13 AM
Hi Marek,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.
 
Regards,
Stefan
the Telerik team
Tags
Treeview
Asked by
Marek
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Marek
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or