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

Help in node template controls alignment

2 Answers 115 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
JR Go
Top achievements
Rank 1
JR Go asked on 14 Jul 2009, 08:44 AM
Hello telerik team,

I'm having trouble aligning my controls inside the node template. The desired look is node values are aligned left, while add/edit/delete controls are aligned right. But the thing is, the controls on the right should all be aligned the same way, regardless of the node's position in the hierarchy.

I was able to do this under IE7 as:

<div style="width:700px">                
        <telerik:RadTreeView runat="server" ID="RadTreeView1"
            <NodeTemplate>                     
                    <div style="text-align:left; width:20%; float:left"
                        <asp:Label ID="Label1"  isText="true" runat="server" Text='<%# Container.Attributes["Text"] %>' /> 
                    </div> 
                     <div style="text-align:right; width:80%; float:right"
                     <asp:LinkButton ID="lbtnAdd" runat="server" Text="Add" CommandName="Add" CssClass="Link" OnClick="lbtnAdd_Click"/>&nbsp;&nbsp; 
                     <asp:LinkButton ID="lbtnEdit" runat="server" Text="Edit" CommandName="Edit" CssClass="Link" OnClick="lbtnEdit_Click"/>&nbsp;&nbsp; 
                                <asp:LinkButton ID="lbtnDelete" runat="server" Text="Delete" CommandName="Delete" CssClass="Link"  OnCommand="lbtnDelete_Click"/> 
                    </div> 
            </NodeTemplate> 
        </telerik:RadTreeView> 
    </div> 

But unfortunately, this doesn't work at all in IE8 or Mozilla. I'm guessing it's the percentage values on the div widths. The problem is, when I supply fixed widths on the divs, they are right aligned depending on the node's level.

Do you guys have a ready made sample to achieve this under IE8? Or perhaps a different approach.

TIA



2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 15 Jul 2009, 01:18 PM
Hi TIA,

Please add the following css style to your page and let us know how it goes:

.RadTreeView div.rtIn {  
  width:100% !important;  

All the best,
Yana
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.
0
JR Go
Top achievements
Rank 1
answered on 15 Jul 2009, 02:03 PM
That worked perfectly! Thanks guys.
Tags
TreeView
Asked by
JR Go
Top achievements
Rank 1
Answers by
Yana
Telerik team
JR Go
Top achievements
Rank 1
Share this question
or