Radiobuttons not working together

5 posts, 0 answers
  1. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 10 Jan 2008 Link to this post

    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

  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 11 Jan 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 11 Jan 2008 Link to this post

    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
  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 11 Jan 2008 Link to this post

    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
  6. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 21 Mar 2011 Link to this post

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready