Hide/Show Checkbox in treeview

8 posts, 0 answers
  1. Shirya
    Shirya avatar
    40 posts
    Member since:
    Sep 2008

    Posted 12 Feb 2009 Link to this post

    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
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 16 Feb 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Shirya
    Shirya avatar
    40 posts
    Member since:
    Sep 2008

    Posted 17 Feb 2009 Link to this post

    thanks.
  5. Daniel
    Daniel avatar
    15 posts
    Member since:
    Jun 2009

    Posted 10 Jun 2009 Link to this post

    Hello,

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

    RadControl Version 8.1.0.0
  6. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 10 Jun 2009 Link to this post

    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.
  7. Daniel
    Daniel avatar
    15 posts
    Member since:
    Jun 2009

    Posted 10 Jun 2009 Link to this post

    I now solved it:
    RadTreeNode myNode = new RadTreeNode("DESCRIPTION"); 
                     
    myTreeView.Nodes.Add(myNode); 
     
    myNode.ShowCheckBox = false
  8. Grant Drury-Green
    Grant Drury-Green avatar
    23 posts
    Member since:
    Jul 2009

    Posted 24 Mar 2010 Link to this post

    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...
  9. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 25 Mar 2010 Link to this post

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