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
WebDataTree missing expand/collapse icon when building tree programmatically
posted

ASP.NET C#, Infragistics 3.5 v11.1

I'm looking for help to understand what I'm missing, or a great code example.  This code works with a standard MS DataTree.

My source hierarchical data is SQL2008 table using hierarchyid datatype, not parent/child columns, and I need to populate a webdatatree.  (Does Infragistics support hierarchyid data type via WHDS or have suggestions on how to consume hierarchyid data?)

I'm trying to build a webdatatree without a webhierarchicaldatasource, instead building out nodes using a manual load-on-demand method.    The following code loads just the notes off the root, however I cannot seem to get the expand/collapse to appear, which I believe I need in order to fire the TreeNodePopulate event to build the descendant level.  I thought setting the Populated property would do this.

Here's the output, a list of level 1 items:

 

 <ig:WebDataTree ID="wdtTree" runat="server" Height="300px" Width="200px"
            StyleSetName="LucidDream"  OnNodePopulate="wdtTree_TreeNodePopulate"              EnableConnectorLines="True"
             InitialExpandDepth="0" EnableExpandOnClick="True" InitialDataBindDepth="0"
              CssClass="Treepadding" Font-Size="Small"
            onnodeclick="wdtTree_NodeClick" >          
        </ig:WebDataTree>           

private void PopulateRootLevel()
        {

           DataTable dt = new DataTable();
            dt = Topics.GetMultipleAsDataTable();
            dt.DefaultView.RowFilter = "TopicLevel = 1";
            dt = dt.DefaultView.ToTable();        

            DataTreeNodeCollection nodes = wdtTree.Nodes;
            foreach (DataRow dr in dt.Rows)
            {
                DataTreeNode dtn = new DataTreeNode();
                dtn.Text = dr["TopicName"].ToString();
                dtn.Value = dr["TopicNode"].ToString();             
                dtn.Populated = true;
                dtn.Expanded = false;               
                nodes.Add(dtn);
            }

}

Thanks for the help.

Jon

 

 

Parents Reply Children
No Data