Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
How to use a WebDataTree custom template when you're binding data programmatically?
posted

C# , ASP.Net 3.5,   Infragistics 11.1

I have a WebDataTree built without using a webhierarchicaldatasource and I would like to use a template for the nodes to change the way the image and text are displayed.  I've used the smart tag to create a template, but I'm unable to use the <%# (Eval("Text")) %> a tags to display data because I'm not binding a data source.   If I use a template similar to the one below, how to I set node values,imageurl, and text in C# code behind?  I've tried accessing the controls to set values but can't seem to figure out how to get to them. 

 

 

 

 

 

 <ig:WebDataTree ID="wdtTree" runat="server" Height="600px" Width="400px"
             OnNodePopulate="wdtTree_TreeNodePopulate" EnableConnectorLines="True"
              OnNodeDropped="wdtTree_OnNodeDropped">
            <DragDropSettings EnableDragDrop="True">
            </DragDropSettings>
            <Templates>
                <ig:ItemTemplate ID="wdtTreeTemplate1" runat="server" TemplateID="NodesTemplate">
                  <Template>
                    <asp:Image runat="server" ID="NodeImage" />
                     <asp:Label runat="server" ID="lblNodeText" Text=""></asp:Label>
                  </Template>
                </ig:ItemTemplate>
            </Templates>
        </ig:WebDataTree>

 Thanks,

Jon