I have a Web Data Tree set up like so:
<ig:WebDataTree ID="webDataTree1" runat="server" OnNodeClick="webDataTree1_NodeClick" Font-Size="Smaller" AutoPostBackFlags-NodeClick="On"></ig:WebDataTree>
The web data tree resides inside a web explorer bar. Each node of the explorer bar has a web data tree inside of it. I didn't design it this way - I'm upgrading from an old system that used the web list bar to hold web data trees.
The code that handles the NodeClick looks like this:
protected void webDataTree1_NodeClick(object sender, DataTreeNodeClickEventArgs e) { try { if (!e.Node.HasChildren) { string[] tableDetail; //tableDetail = e.Node.DataKey.ToString().Split('|'); 16 Feb 2015 EMF tableDetail = e.Node.Key.ToString().Split('|'); object[] getFilter = new object[5]; getFilter[0] = Int32.Parse(tableDetail[0].ToString()); getFilter[1] = tableDetail[1]; getFilter[2] = tableDetail[2]; getFilter[3] = e.Node.Text; getFilter[4] = tableDetail[3]; _delLoadFilterpage.DynamicInvoke(getFilter); } }
// .. catch code is here & the end of the method.
There are two scenarios that happen here.
The first time I click on a node in the web data tree, the nodeclick event does not fire. However, all of the nodes within the web explorer bar get moved down into other nodes. For example, the first three items (which start off in the first menu) wind up in the second menu, the first and third menus are blank, then the fourth holds the contents of the second menu, and so on.
The second time I click on a node, it fires the NodeClick event, at which point all of the data is scrambled, none of the arguments are correct, and I wind up with an exception. Please let me know what other information you need, thanks!
I've tried this with IE11 and Firefox 35.0.1. The other problem that I'm having (I don't remember if I've mentioned this or not) is that the first time I click the onclick event does not fire; that is when the menu options shift downward. The second time I click, the onclick event fires twice. The code is fairly complex, because the menu is populated using a dataset that is then programmatically added to the data tree. Here is the code that adds the data to the tree:
this.webDataTree1 = (WebDataTree)this.FindControl("webDataTree1"); foreach (DataRow level2DataRow in menuDS.Tables["Menu2"].Rows) // Top Level { DataTreeNode n = new DataTreeNode(); n.Text = (string)level2DataRow.ItemArray[1]; // [1] = Item name n.Key = (string)level2DataRow.ItemArray[2]; // [2] = Item ID webDataTree1.Nodes.Add(n); foreach (DataRow level3DataRow in menuDS.Tables["Menu3"].Rows) // Child Level { DataTreeNode nChild = new DataTreeNode(); int menuLevel3ParentIndex = (int)level3DataRow.ItemArray[3]; // [3] = Parent ID if (menuLevel3ParentIndex == (int)level2DataRow.ItemArray[0]) // [0] = ID { nChild.Text = (string)level3DataRow.ItemArray[1]; nChild.Key = (string)level3DataRow.ItemArray[2]; n.Nodes.Add(nChild); foreach (DataRow level4DataRow in menuDS.Tables["Menu4"].Rows) // Lowest level permitted w/ database schema { DataTreeNode nGrandChild = new DataTreeNode(); int menuLevel4ParentIndex = (int)level4DataRow.ItemArray[3]; if (menuLevel4ParentIndex == (int)level3DataRow.ItemArray[0]) { nGrandChild.Text = (string)level4DataRow.ItemArray[1]; nGrandChild.Key = (string)level4DataRow.ItemArray[2]; nChild.Nodes.Add(nGrandChild); } } } } }
Here is the code that adds the trees to the web explorer bar:
DataSet ds = business_process_layer_object.GetMenuGroup(Context.User.Identity.Name.ToString()); if(ds.Tables[0].Rows.Count > 0) { int i = 0; foreach (DataRow dr in ds.Tables[0].Rows ) { Infragistics.Web.UI.NavigationControls.ExplorerBarGroup grp = new Infragistics.Web.UI.NavigationControls.ExplorerBarGroup(); grp.Text = dr[0].ToString(); grp.Value = dr[0].ToString(); WebExpBar1.Groups.Add(grp); ExplorerBarItem item = new ExplorerBarItem(); item.TemplateId = "Template1"; item.Value = grp.Text; WebExpBar1.Groups[i].Items.Add(item); i++; } }
I don't have a dumbed down version of the code that would make this easy to reproduce, I'm hoping that you can look at my code and say, "oh, here is the problem, you haven't set this or you're assigning this incorrectly."
Here is the markup that puts the explorer bar into place in the overall aspx page:
<ig:WebExplorerBar ID="WebExpBar1" runat="server" EnableSelection="false" TabIndex="-1" BackColor="Transparent" BorderStyle="None" GroupExpandBehavior="SingleExpanded" AnimationDuration="200" AnimationEquationType="Linear" Font-Size="Small"> <Templates> <ig:ItemTemplate runat="server" ID="WebExpBar1Template1" TemplateID="Template1"> <Template> <uc1:uctree ID="uctree" Visible="true" runat="server"></uc1:uctree> </Template> </ig:ItemTemplate> </Templates> </ig:WebExplorerBar>
Let me know if that is enough info for you! You may have a data source that can stand in for the one I'm using, because I don't think I can send out the data and the data processing logic we're using to populate.
Hello,
Could you please add more details? As this is a custom approach, runnable code sample reproducing the issue will be best. Is this issue consistent or it depends on the environment like different browsers for example? I am looking forward more feedback from you.
Minor edit,
Infragistics45.Web.v14.1, Version=14.1.20141.2392