I load a webdatatree from a dataset using relations. I have 3 levels of nodes in the tree but only want to show checkboxes for the 1st level of nodes. Is this possible? If so, how do I do this programmatically using vb.net. Thanks.
Hi jcom39201,
Enabling WebDataTree's CheckBoxMode currently applies to all nodes and levels. I would suggest that you employ templates for your nodes to add checkboxes only at your required levels.
For instance, here is the markup for a WebDataTree with a templated root node:
<ig:WebDataTree ID="WebDataTree1" runat="server" CheckBoxMode="Off" Height="300px" Width="200px"> <Nodes> <ig:DataTreeNode Text="Root Node" > <Template > <asp:CheckBox Text="text" runat="server" /> </Template> <Nodes> <ig:DataTreeNode Text="Child Node"> <Nodes> <ig:DataTreeNode Text="Child Node"> <Nodes> <ig:DataTreeNode Text="Child Node"> </ig:DataTreeNode> <ig:DataTreeNode Text="Child Node"> </ig:DataTreeNode> </Nodes> </ig:DataTreeNode> </Nodes> </ig:DataTreeNode> </Nodes> </ig:DataTreeNode> </Nodes> </ig:WebDataTree>
A guide for node templating in the WebDataTree is available at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebDataTree_Node_Templating.html
Please tell me if this helps.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Please contact me if you need further assistance.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Please let me know if you need further assistance with this matter.
In order to add a template in the code-behind, you would need to create your own class(es) which implement the ITemplate. The following guide gives an example of that for the WebDropDown, but the principle is the same for the tree:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebDropDown_Create_a_Multi_Column_WebDropDown_using_Templates.html
So to apply a template to all nodes in the tree you would use something like:
WebDataTree1.ItemTemplate =
new nodeTemplate();
Templates may also be applied to single nodes if needed.
You may find more general information on templating the WebDataTree at:
Please let me know if you have any questions.
Petar,
Sorry for the delay in getting back to you. I did get this working using some script but I like the approach you mention of using a template. I populate my tree at runtime and am not sure how to incorporate the template when doing so. Do you have an example?
Thanks!