TreeView with updatePanel problem

Discussion in 'ASP .Net Web Controls' started by Ringdrossel, Jun 1, 2007.

  1. Ringdrossel

    Ringdrossel Guest

    Hi I use the TreeView control inside an ajax update panel. This is working
    fine till I just implement the TreeNodeExpanded event. Even without writing
    any code inside that implementation!

    Here is what happens:

    I got a tree structure like

    root
    - node
    -- subnode1
    --- subnode1.1
    ---- subnode1.1.1
    --- subnode1.2
    -- subnode2
    - node2

    I open the root everything is fine. I open subnode 1 everything is fine, too.
    Now I open subnode1.1 and subnode1 (parent of subnode1.1) closes!
    What the???

    Here is the code I used to implement that special event:

    Protected Sub CategoryTreeView_TreeNodeExpanded(ByVal sender As
    System.Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs)
    Handles CategoryTreeView.TreeNodeExpanded
    'really no code here!!
    End Sub

    What happens when I debug the code is:

    The first time TreeNodeExpanded is called correctly.
    But then a full Postback is done.
    Next is a new call to TreeNodeCollapsed
    -> here the parent of the subnode1.1 is the object calling this handler
    (subnode1)!
    -> this has the property expanded=false! whyever!
    Next another postback is done
    Next finally TreeNodeExpanded gets called again with subnode1.1
    where expanded property is true!

    Did anybody experience the same problem? And if so does a good workaround
    exist? I read a fix where in every event of this type: expanded, collapsed,
    selectedNodeChange you suppress the closing of the root node but this didn't
    solve
    my problem since its not the root node but the parent node that wants to
    close.

    This drove me crazy- perhaps someone has a solution?

    Regards Sven
    Ringdrossel, Jun 1, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,415
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  2. Replies:
    3
    Views:
    472
    Rob Meade
    Aug 8, 2007
  3. Alhambra Eidos Kiquenet

    Using Treeview inside UpdatePanel control

    Alhambra Eidos Kiquenet, Jun 12, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    450
    Alhambra Eidos Kiquenet
    Jun 13, 2008
  4. Nathan Sokalski
    Replies:
    1
    Views:
    572
    miher
    Jun 15, 2009
  5. RJN
    Replies:
    0
    Views:
    1,061
Loading...

Share This Page