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

Wrap Text RadTreeView

2 Answers 116 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
_je_
Top achievements
Rank 1
_je_ asked on 24 Jan 2014, 03:15 AM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Jan 2014, 07:09 AM
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.
0
_je_
Top achievements
Rank 1
answered on 24 Jan 2014, 07:18 AM
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
Tags
TreeView
Asked by
_je_
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
_je_
Top achievements
Rank 1
Share this question
or