Hi,
I have webdatatree like the below with node template.
<ig:WebDataTree ID="WebDataTreeSample" runat="server" DataSourceID="XmlDataSource1"
Height="100%" Width="100%" Style="float: left" OnNodeBound="WebDataTreeSample_NodeBound" EnableHotTracking="True" OnNodeDropped="WebDataTreeSample_NodeDropped">
<ClientEvents NodeClick="onNodeClicked" />
<ig:DataTreeNodeBinding DataMember="Group" TextField="Name" ValueField="Name" /> <ig:DataTreeNodeBinding DataMember="Feed" TextField="Name" ValueField="Name" /> </DataBindings>
<Templates>
<ig:ItemTemplate>
<Template>
<asp:Label ID="L" runat="server"></asp:Label>
</Template>
</ig:ItemTemplate>
</Templates>
</ig:WebDataTree>
On Node_dataBound event, I am trying to find the label 'l' like the below:
Label l = e.Node.FindControl("L").
I am not able to find control, the above code is not working. How to find control which is in Template of WebDataTree?
Thanks
Try to call EnsureTemplate() before FindControl:
e.Node.EnsureTemplate();Label l = e.Node.FindControl("L");