I am using ManualSmartCallbacks and would like to set the DataPath client-side in the DemandLoad event, but there doesn't seem to be an Method to do this.
I need to do this because DataPath is the only field that seems to stay around when populating a tree view the DemandLoad server-side event. I'm setting data to the tag, but when that node is expanded the tag is not passed to the server. In reading other posts, I noted that DataPath is the only field that is persisted throughout, so in my server-side code I set the DataPath property also. I would like to be able to add additional client-side info and pass it up, but since I can't set DataPath, I seem to be restricted.
I am using 2007-3, so maybe there's an appropriate method in 2008-3.
Suggestions?
Thanks!
HelloYou can use the property Tag of node and set value. Please take a look code below:
ASPX code: <ignav:UltraWebTree ID="UltraWebTree1" LoadOnDemand="ManualSmartCallbacks" runat="server" OnDemandLoad="UltraWebTree1_DemandLoad"> <ClientSideEvents DemandLoad="Load" /> <Nodes> <ignav:Node Text="R" ShowExpand="true"> </ignav:Node> </Nodes> </ignav:UltraWebTree>
JS code: <script type="text/javascript"> function Load(menuId, itemId) { var node = igtree_getNodeById(itemId); node.setTag("tag");
} </script>C# code: protected void UltraWebTree1_DemandLoad(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { Label1.Text = e.Node.Tag.ToString(); }
Hope this helps.
I guess I did not make myself clear.
The server creates the top level node and it contains a Tag. When the node is expanded, the server side code creates child nodes which contain Tags. However, when one of these nodes is expanded the Tag is not passed to the server. I can trap the client-side DemandLoad and I see the tag is in the node and it contains the tag (i.e., igtree_getNodeById(itemId).getTag()). However, the node on the server side looks like this:
?e.Node{Infragistics.WebUI.UltraWebNavigator.Node} CheckBox: NotSet {2} Checked: False CssClass: Nothing DataBound: False DataItem: Nothing DataKey: Nothing DataPath: "127:2<2>dir<2>8<1>" Enabled: True Expanded: False FirstNode: Nothing Hidden: False HiliteClass: "" HoverClass: "" Images: {Infragistics.WebUI.UltraWebNavigator.NodeImageUrls} ImageUrl: "" Index: 0 IslandClass: "" Level: 0 LoadOnDemand: False Margin: {Infragistics.WebUI.Shared.Margin} NextNode: Nothing NextVisible: Nothing Nodes: {Infragistics.WebUI.UltraWebNavigator.Nodes} Padding: {Infragistics.WebUI.Shared.Padding} Parent: Nothing PrevNode: Nothing PrevVisible: Nothing Selected: {"Object reference not set to an instance of an object."} SelectedImageUrl: "" ShowExpand: False Style: {Infragistics.WebUI.Shared.Style} Styles: {Infragistics.WebUI.Shared.Style} Tag: Nothing TagString: Nothing TargetFrame: Nothing TargetUrl: Nothing Text: Nothing Title: Nothing ToolTip: Nothing
Note that the DataPath contains information where nothing else does! This, along with the Tag and everything else, is set on the server side in the initial DemandLoad. My logic on the Server-side checks to see if e.node.Tag IS NOTHING, and uses the DataPath instead. This works fine, but I want to pass additional client-side status information to the server, thus I want to setDataPath.
Just for grins I added a igtree_getNodeById(itemId).setTag("xxx") in the client-side DemandLoad, but I did not see the xxx on the server-side.
Hope this clarifies my desire to setDataPath.