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=tr ue
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, TreeViewClickEv entArgs e)
{
TreeNode objNode = (TreeNode)e.Nod e;
string strIndex = objNode.GetNode Index();
}
You could probably even set the current index to equal the expanded node.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"clsmith66" <cl*******@disc ussions.microso ft.com> wrote in message
news:68******** *************** ***********@mic rosoft.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?