Re: TreeView help please

From: clsmith66 (clsmith66_at_discussions.microsoft.com)
Date: 12/09/04


Date: Wed, 8 Dec 2004 16:09:04 -0800

Thank you Mark for your quick response. I was finaly able to track the node
indexes(?) I needed by using the treeviews Expand event but I have a minor
problem with the click event. This is what I did:
1. Set the tree to AutoPostBack=true
2. Set the IsPostBack in the Page_Load to exit sub if true
3. Code in expand event is only one line. It sets the value of a hidden
field equal to the index of the e.Node argument.
All this works but every time I expand a node now I have a delay of approx.
10 seconds before I can do anything else on the page. Any ideas why? The
page is large with three tabs and three treeviews but if the IsPostBack is
set to only exit the page_load shouldn't that skip all the building of the
page and return control back to the user? Thanks for any clues you might be
able to offer.

"Mark Fitzpatrick" wrote:

> Something to keep in mind is that expanding is not the same as selecting a
> node. By default, a node that is selected can also fire an expanded event.
> Expanding a node therefore doesn't necessarily select it. You have to
> capture the Expand event with your own handler. Let's say we had a tree
> named objTree. Capturing the node that was expanded may look something like
> this:
>
> private void objTree_Expand(object sender, TreeViewClickEventArgs e)
> {
> TreeNode objNode = (TreeNode)e.Node;
> string strIndex = objNode.GetNodeIndex();
> }
>
> You could probably even set the current index to equal the expanded node.
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "clsmith66" <clsmith66@discussions.microsoft.com> wrote in message
> news:68394A07-34F8-4A11-8A96-B890214792B5@microsoft.com...
> > In a treeview, I am trying to store the index of every treenode as it
> > expands
> > in a hidden input box. If I click on the node itself, it expands and I
> > can
> > capture the node index no problem. If I click on the plus sign however,
> > the
> > selected index doesn't change so I can't capture the index of the newly
> > expanded node. Does any one know how to change the selected node when a
> > plus
> > sign is clicked?
>
>
>



Relevant Pages

  • Re: treeView Expand/Collapse problem
    ... If you want it to happen, you need to use the Expand event of the treeview control and include code to collapse the nodes which are already expanded. ...
    (microsoft.public.access.formscoding)
  • Re: treeView Expand/Collapse problem
    ... So what would be the code to collapse the nodes which are already expanded? ... If you want it to happen, you need to use the Expand event ... Note also that the Expand event of the treeview control is not listed in the ...
    (microsoft.public.access.formscoding)
  • Re: treeView Expand/Collapse problem
    ... So what would be the code to collapse the nodes which are already expanded? ... If you want it to happen, you need to use the Expand event ... Note also that the Expand event of the treeview control is not listed in the ...
    (microsoft.public.access.formscoding)
  • Re: [PHP] International Addresses and Telephones
    ... > need to expand this to capture non-US info, so I was hoping for some ... > guidance on forms and table structures. ... Admin / Developer ...
    (php.general)
  • Re: bulk_capture
    ... I am using Premiere and secondly both internal and external HD ... space and have about 300 gig but would expand this - my main concern was ... reason why you can't 'capture' all 6 hrs. ...
    (uk.rec.video.digital)