Wrap Text RadTreeView

3 posts, 0 answers
  1. _je_
    _je_ avatar
    4 posts
    Member since:
    Jan 2014

    Posted 23 Jan 2014 Link to this post

    I have created a RadTreeview and made sure that the word-spacing CSS of it has a normal value.
    How would i align the Labels vertically?

    Please refer to the attached image
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Jan 2014 Link to this post

    Hi Jesh,

    As a work around please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="true">
        <Nodes>
            <telerik:RadTreeNode Text="Node1">
                <Nodes>
                    <telerik:RadTreeNode ImageUrl="../Images/plus.gif" Text="Node1.1">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode ImageUrl="../Images/plus.gif" Text="Node1.2">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode ImageUrl="../Images/plus.gif" Text="Node1.3">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Node1.4" Checkable="false">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>
        </Nodes>
    </telerik:RadTreeView>

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        foreach (RadTreeNode node in RadTreeView1.Nodes)
        {
            if (node.Nodes.Count != 0)
            {
                foreach (RadTreeNode node1 in node.Nodes)
                {
                    if (node1.Checkable == false)
                        node1.Style.Add("margin-left", "15px");
                }
            }
        }
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. _je_
    _je_ avatar
    4 posts
    Member since:
    Jan 2014

    Posted 24 Jan 2014 Link to this post

    Hi Princy

    Good Day,

    I forgot to tell that the list text is wrapped, so that any long phrases will automatically be on the next line.

    Refer to the attached image.
    Thank you for your response
Back to Top