How the TreeView can automatically expand a path i have accessed before?

S

Steven

Hello,

I have a problem in using TreeView.
I want to know how the TreeView can automatically Expand a path
I have accessed before? I have tried to use "path.Expand()", but
it seems no good working. Does anyone can give me any advise or
show me somecode for sample?.

Thanks.

bestRegards from
Steven Suen
2003/8/19
 
T

Tom Monahan

I'm not sure I understand your problem. Perhaps you could explain it more
to me.

Here is some of the behavior I see. Maybe you could tell me if this is
related to what you're talking about.

When I expand sub items underneath and item, collapse the item, and then
expand it again, the sub items remain in the expanded state. This sounds
like what you are asking for but I suspect you're asking about something
different.

As you suggest, you can programmatically expand nodes.

TreeNode tn = tv1.SelectedNode;
if (tn != null)
{
if ("you want to expand all sub nodes")
tn.ExpandAll();
else
tn.Expand();
}

Again, I'm probably not answering your question. Please try to expain it
to me more.

Thanks
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top