Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...TreeView HelpTreeView Help
Previous
 
Next
New Post
1/8/2009 6:08 PM
 

I am attempting to use an Ajax TreeView component from ComponetOne and have created a TreeView.ascx contol. I can load the treeview control fine and load some initial items but I would like to load the tree dynamically using the PopulateOnDemand feature. The problem I have is that when I click on a tree item the ItemPopulate event never fires. I’ve tested this same structre outside of DNN with a webpage .aspx and control .ascx with the treeview and everything works as exected – so I suspect it has something to do with the DNN structure. Below is my code in the .ascx

 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
                If Session("ResourceItem") IsNot Nothing Then
                    Session("CurrentPath") = Path.GetDirectoryName(CType(Session("ResourceItem"), ResourceItem).FullName)
                    Session("ResourceItem") = Nothing
                End If
 
                Dim thePath As String
                thePath = Session("CurrentPath")
 
                If String.IsNullOrEmpty(thePath) Then
                    thePath = Me._RootPath
                Else
                    If Not thePath.EndsWith("\") Then thePath += "\"
                    If Not Me._RootPath.EndsWith("\") Then Me._RootPath += "\"
                End If
                LoadResources(thePath)
            End If
        End Sub
 
 
Private Sub LoadResources(ByVal thePath As String, Optional ByVal ItemToLoad As C1.Web.Command.C1WebTreeViewItem = Nothing)
            Dim itm As C1.Web.Command.C1WebTreeViewItem
            Dim rc As New ResourceCollection
            rc.UserInfo = Me._UserInfo
            rc.ReadPath(thePath)
 
            For Each ri As ResourceItem In rc
                itm = New C1.Web.Command.C1WebTreeViewItem
 
                itm.PopulateOnDemand = True
                itm.Text = ri.DisplayName
                itm.CommandArgument = ri.FullName
 
                If IsNothing(ItemToLoad) Then
                    Me.C1WebTreeView1.Items.Add(itm)
                Else
                    If IsNothing(ItemToLoad.ChildGroup) Then ItemToLoad.CreateChildGroup()
                    ItemToLoad.ChildGroup.Items.Add(itm)
                End If
            Next
        End Sub
 
Protected Sub C1WebTreeView1_ItemPopulate(ByVal sender As Object, ByVal e As C1.Web.Command.C1WebCommandEventArgs) Handles C1WebTreeView1.ItemPopulate
            LoadResources(e.CommandArgument, e.Item)
 
        End Sub

thx for any help

-Tom

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...TreeView HelpTreeView Help


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out