How to hide the Plus Minus of Root Node only

4 posts, 0 answers
  1. Haroon
    Haroon avatar
    3 posts
    Member since:
    Jan 2009

    Posted 30 Jan 2009 Link to this post

    Hi Telerik,
    I just came across an issue and if you can please guide me in this regard.
    The issue is that
    I want that only the root node (First Node) of tree view dont show its Plus Minus (sign) and it reduce its (only its) indentation as well.
    I can see that the property for plus minus is available but that property implements on whole treeview, which is not acceptable to us. And we will need to reduce its indentation as well because if somehow I could be able to hide the plus minus sign the gap between the treeview control border and its first node will look odd.

    I hope,I can cleared my point. I wanted to send u the dummy treeview pic to show exactly what I want but i guess attached is not provided this Telerik threads.To understand my application, Its tree view is like that I have One node and all about 100 or so childs and sub childs are under that Single node. So we are looking to hide the Top (Root) node Plus Minus sign and indent the treeview little left to the gap dont look too much.

    Looking forward to your quick and helpful response as always.

    Regards,
    Haroon.

  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 02 Feb 2009 Link to this post

    Hello Haroon,

    Thank you for writing.

    The Telerik Forums do not allow attachments for security purposes - if you would like to send us your code, you will need to start a support ticket.

    You can hide the +/- symbol by collapsing image element in Layout event:
     
    void radTreeView1_Layout(object sender, LayoutEventArgs e)  
    {  
        this.radTreeView1.TreeViewElement.Children[1].Children[0].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;  

    Unfortunately, there is not a way to remove the node indent and show it at the left edge.
     
    Do not hesitate to contact me again if you have other questions.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Haroon
    Haroon avatar
    3 posts
    Member since:
    Jan 2009

    Posted 03 Feb 2009 Link to this post

    Hi Martin Vasilev and Telerik team,
    The telerik Team continues with their extra ordinary support (Y).

    Well i tried the above code in my project and its working as per expected, but the empty space is giving a little odd look. I really appreciate  if you can give me some idea / trick to  make it feel like left indented . I was thinking about dragging the treeview control behind the left border. But in that case i have to manually set the controls location every time user change form location or resize, which i don't think i will do. Right now I have dock= Full the control to a panel. which saves me from lot of coding.

    Looking forward to your quick reply.

    Regards,
    Haroon.
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 05 Feb 2009 Link to this post

    Hello Haroon,

    Thank you for writing.
     
    I am afraid that what you need a somewhat non-standart feature. If we remove the tree indentation it is not a tree anymore. Currently the tree indentation is applied to every level and is hardcoded to be at least 16 pixels. If we were able to set it to 0, it will become a list, not a tree, with no indentation whatsoever.


    Greetings,
    Victor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top