treeviewnode TemplateId in code behind

Not Answered This post has 0 verified answers and 3 replies

Not Ranked
Posts: 16
sushindus Posted: Tue Dec 13, 2011 @ 3:01 AM
HI experts following is my code, I am adding new node in asp button click but its not taking template id.
Please help me

aspx.cs

TreeViewNode Interests = new TreeViewNode();
                Interests.Value = "test";
                Interests.Text = "test";
                Interests.ID = "test";
                Interests.TemplateId = "ddlTemplate";
                trvKGens.SelectedNode.Nodes.Add(Interests);
                Interests.ImageUrl = "images/Event.jpg";


.aspx

 <asp:Panel ID="Panel1" runat="server" Visible="true" width="100px">
                                              
                                               

                                            <ComponentArt:TreeView ID="trvKGens" Width="200px"
                                                  CssClass="TreeView"
                                                  NodeCssClass="TreeNode"
                                                  HoverNodeCssClass="HoverTreeNode"
                                                  SelectedNodeCssClass="SelectedTreeNode"
                                                  NodeEditCssClass="NodeEdit"   
                                                  LineImageWidth="19"
                                                  LineImageHeight="20"
                                                  DefaultImageWidth="16"
                                                  DefaultImageHeight="16"
                                                  NodeLabelPadding="3"
                                                  ShowLines="True"
                                                  LineImagesFolderUrl="images/lines/"
                                                  EnableViewState="true"
                                                  ClientScriptLocation="client_scripts/componentart_webui_client/"
                                                  AutoPostBackOnSelect="true"
                                                  AutoPostBackOnNodeRename="true"
                                                  AutoPostBackOnNodeMove="true"
                                                  DragAndDropEnabled="true"
                                                  NodeEditingEnabled="true"
                                                  onNodeselected="trvKGens_NodeSelected"
                                                  OnNodeRenamed="trvKGens_NodeRenamed"
                                                  OnNodeMoved="trvKGens_NodeMoved"                                                 
                                                  AutoScroll="true"
                                                 
                                                  runat="server">
                                                  <Templates>
                                                     <ComponentArt:NavigationCustomTemplate id="ddlTemplate">
                                                        <Template>
                                                           <asp:DropDownList ID="ddlKgen" runat="server" onselectedindexchanged="ddlKgen_SelectedIndexChanged">
                                                                <asp:ListItem Selected="True" Text="Guide" Value="Guide"></asp:ListItem>
                                                                 <asp:ListItem Text="Event" Value="Event"></asp:ListItem>
                                                                  <asp:ListItem Text="Help" Value="Help"></asp:ListItem>
                                                                   <asp:ListItem Text="Project" Value="Project"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </Template>
                                                     </ComponentArt:NavigationCustomTemplate>

                                                     <ComponentArt:NavigationCustomTemplate id="NavigationCustomTemplate1">
                                                        <Template>
                                                            <asp:TextBox ID="TextBox24" runat="server"></asp:TextBox>
                                                        </Template>
                                                     </ComponentArt:NavigationCustomTemplate>
                                                  </Templates>
                                                

                                                </ComponentArt:TreeView></asp:Panel>

thanks in advance

All Replies

Top 10 Contributor
Posts: 2,373
harish Posted: Tue Dec 13, 2011 @ 5:43 AM

Hello,

 

Thanks for submitting your query with ComponentArt Forum.

 

After adding the nodes that reference templates with their TemplateId property, you should make a call to TreeView.ReloadTemplates(). Please refer the following forum links for the same:

 

<http://www.componentart.com/community/forums/p/2734/2734.aspx#2734>
<http://www.componentart.com/community/forums/p/6864/6911.aspx#6911>

 

Thank you.

 

Harish Malhotra

Not Ranked
Posts: 16
sushindus Posted: Tue Dec 13, 2011 @ 8:33 PM
thanks for helping me
TreeView.ReloadTemplates() method is not supporting.
I am using Componentart version 2.0.1983.0
Top 10 Contributor
Posts: 2,373
harish Posted: Wed Dec 14, 2011 @ 4:59 AM

Hello,

 

Thanks for getting back to me and providing the version information.

 

The version which you are using is a legacy product version and our latest build version is ComponentArt UI Framework 2012 for .NET (build

2012.1.1016). In between these two build versions there have been lot of new build versions rolled out. So, you will find a lot of new

additions of controls, features to existing controls, API enhancement(both server side as well as client side) and bug fixes done.

 

The ReloadTemplates method is available in that build version:

 

<http://docs.componentart.com/#UIFramework/2012/ComponentArt.Web.UI.AJAX.server/ComponentArt.Web.UI~ComponentArt.Web.UI.BaseNavigator~ReloadT

emplates.html>

 

 

So, I suggest you to test the same using ComponentArt UI Framework 2012 for .NET (build 2012.1.1016). This could be obtained from the url:

 

<http://www.componentart.com/download/uiframework.aspx>

 

I'm sorry I couldn't be more helpful than this.


Thanks

 

Harish Malhotra

Page 1 of 1 (4 items)