TreeView
-
Hi all. I am working on a page with a treeview on that state needs to be saved on postback(Meta Refresh). Now I've got the following code to create a cookie if a node is expanded
Protected Sub tvSideNav_NodeExpanded(ByVal sender As Object, ByVal e As ComponentArt.Web.UI.TreeViewNodeEventArgs) Handles tvSideNav.NodeExpanded
Try
Dim i As Integer
For i = 0 To Request.Cookies.Count - 1
Request.Cookies.Remove(i)
NextDim UserCookie As HttpCookie = New HttpCookie("UserCookie") UserCookie.Name = "Details" UserCookie.Values.Add("node", tvSideNav.SelectedNode.GetCurrentIndex.ToString) Response.Cookies.Add(UserCookie) Catch ex As Exception End Try End Sub
but this code doesn't seem to fire when a node is expanded. Can someone tell me why this is?
Stephen Lintott Bsc IT (RAU)
-
Hi all. I am working on a page with a treeview on that state needs to be saved on postback(Meta Refresh). Now I've got the following code to create a cookie if a node is expanded
Protected Sub tvSideNav_NodeExpanded(ByVal sender As Object, ByVal e As ComponentArt.Web.UI.TreeViewNodeEventArgs) Handles tvSideNav.NodeExpanded
Try
Dim i As Integer
For i = 0 To Request.Cookies.Count - 1
Request.Cookies.Remove(i)
NextDim UserCookie As HttpCookie = New HttpCookie("UserCookie") UserCookie.Name = "Details" UserCookie.Values.Add("node", tvSideNav.SelectedNode.GetCurrentIndex.ToString) Response.Cookies.Add(UserCookie) Catch ex As Exception End Try End Sub
but this code doesn't seem to fire when a node is expanded. Can someone tell me why this is?
Stephen Lintott Bsc IT (RAU)
I figured it out. In the aspx page in the treeview component you have to set the following.
AutoPostBackOnNodeExpand ="true "
Stephen Lintott Bsc IT (RAU)