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

Treeview node text is not displaying

1 Answer 152 Views
This is a migrated thread and some comments may be shown as answers.
subrahmanyam kameswara
Top achievements
Rank 1
subrahmanyam kameswara asked on 06 May 2010, 02:47 PM


When I am using node template in treeview the text of that treeview is not displaying at rum time.

could any one plz help me here is the code.

<telerik:RadTreeView runat="server" ID="RadTreeView1" Skin="Outlook">
                <telerik:RadTreeNode Text="POLICY" Expanded="true">
                        <telerik:RadTreeNode Text="Policy Information">
                        <telerik:RadTreeNode Text="Applicants">
                                <table id="tblApplicants" style="display: block; border: 0; width: 265px">
                                            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                                                <asp:XmlDataSource ID="XmlApplicant" runat="server" DataFile="~/XMLs/EntitiesInfo.xml"
                                                <telerik:RadGrid ID="radGVApplicant" runat="server" Width="265px" AllowPaging="True"
                                                    PageSize="2" AutoGenerateColumns="False" Skin="Default" GridLines="None" FooterStyle-CssClass="GVHdrColor"
                                                    SelectedItemStyle-CssClass="GvRead" CommandItemStyle-Wrap="true" DataSourceID="XmlApplicant"
                                                    <SelectedItemStyle CssClass="MySelectedClass" />
                                                    <MasterTableView CommandItemDisplay="None" SkinID="GVHeadrColor">
                                                                No records found.
                                                        <AlternatingItemStyle CssClass="MyRowClass" />
                                                        <HeaderStyle CssClass="grdHdr" />
                                                        <ItemStyle CssClass="grdItem" />
                                                        <FooterStyle CssClass="grdPager" />
                                                            <telerik:GridTemplateColumn DataField="CrsID" HeaderText="#" HeaderStyle-Width="5%"
                                                                HeaderStyle-CssClass="grdHdr" ItemStyle-CssClass="grdItem" FooterStyle-CssClass="grdPager">
                                                                    <asp:Label ID="lblSno" runat="server" Text='<%# XPath("SNo") %>' SkinID="GridLbl"></asp:Label>
                                                            <telerik:GridTemplateColumn DataField="Name" HeaderText="Name" HeaderStyle-Width="45%"
                                                                UniqueName="Name" HeaderStyle-CssClass="grdHdr" ItemStyle-CssClass="grdItem"
                                                                    <asp:Label ID="lblAppName" runat="server" Text='<%# XPath("Name") %>' SkinID="GridLbl"></asp:Label>
                                                            <telerik:GridButtonColumn HeaderStyle-Width="5%" HeaderStyle-CssClass="grdHdrDel"
                                                                ItemStyle-CssClass="grdItemDel" FooterStyle-CssClass="grdPager" ButtonType="ImageButton"
                                                                HeaderText="Delete" ImageUrl="../Images/deleteicon_disabled.gif" ConfirmDialogType="RadWindow"
                                                                ConfirmText="Are you sure want to delete Applicant?">
                                                    <ClientSettings EnablePostBackOnRowClick="true">
                                                        <Selecting AllowRowSelect="true" />
                                                        <Scrolling AllowScroll="false" />
                        <telerik:RadTreeNode Text="Primary Address"></telerik:RadTreeNode>
                        <telerik:RadTreeNode Text="Mailing Address"></telerik:RadTreeNode>
                        <telerik:RadTreeNode Text="Underwriter Questions"></telerik:RadTreeNode>
                        <telerik:RadTreeNode Text="Worker's Comp. Policy Information"></telerik:RadTreeNode>

1 Answer, 1 is accepted

Sort by
Nikolay Tsenkov
Telerik team
answered on 07 May 2010, 03:39 PM
Hi subrahmanyam kameswara,

As difference to the RadPanelBar, the templates in the RadTreeView, e.g. the NodeTemplate-s are completely removing the default template. For example, if you create an ItemTemplate for PanelBar's items the Text property of the items will still be shown, but in the TreeView the NodeTemplate completely replaces the default layout.

In order to show the Text property of the nodes, you should use the following in your NodeTemplate:
    <asp:Label Text='<%# DataBinder.Eval(Container, "Text") %>' />
    /// ...
    /// Here goes the rest of the template

With this additional line the text property will be added to the layout of all of your nodes.

Hope this will help you!

Nikolay Tsenkov
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.
Asked by
subrahmanyam kameswara
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question