I am trying to change one element in the NodeTemplate of a Treeview and my code is not working. It executes fine but the change doesn't show up on the screen. What am I doing wrong?
Here is the the code:
Here is the defintion
Here is the the code:
protected void RadTreeView1_NodeDataBound (object sender, RadTreeNodeEventArgs e){ e.Node.ExpandMode = TreeNodeExpandMode.ServerSide; if (e.Node.Text == "Retailers") { RadTreeNode node = RadTreeView1.Nodes[0]; HyperLink hyperLink = (HyperLink)node.FindControl ("HyperLink2"); hyperLink.Visible = false; // this what is want to do
hyperLink.Text = "<span style=\"color: #BBBBBB\">X</span>"; // this is test to see that the Hyperlink Text changes
// Neither of the above two lines produce the screen changes I am looking for
}}Here is the defintion
<telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="True" MultipleSelect="True" EnableViewState="true" ShowLineImages="False" EnableEmbeddedSkins="False" Skin="tree_2" OnNodeClick="RadTreeView1_NodeClick" OnNodeDataBound="RadTreeView1_NodeDataBound" OnClientNodeCollapsed="OnClientNodeCollapsed" OnClientNodeExpanded="OnClientNodeExpanded" OnClientLoad="onLoad"> <NodeTemplate> <small> <asp:Label ID="lblnodeText" Text='<%#Eval("Title") %>' runat="server" /><asp:Label ID="lblCatId" Text='<%#Eval("Id") %>' runat="server" Visible="false"></asp:Label><asp:Label ID="lblisCustomer" Text='<%#Eval("isCustomer") %>' runat="server" Visible="false"></asp:Label><asp:Label ID="Description" runat="server" Text='<%#Eval("description") %>' Visible="false" /><asp:HiddenField ID="DescriptionVisible" runat="server" Value='<%#Eval("descriptionVisible") %>' /> </small> <small><asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl=<%# "javascript:Popup_Window('category_detail','" + DataBinder.Eval(Container.DataItem, "id").ToString() + "')"%> style="text-decoration: none;"><span style="color: #BBBBBB">e</span></asp:HyperLink> </small> </NodeTemplate></telerik:RadTreeView>