Find treenode by DataPath, not ValuePath

A

alexandis

Hi,

i use xml sitemap, several big parent node groups. In each parentnode
tag i want to specify url as initial 'selected' url to go to when
loading the page.
So i have the following structure
<siteMapNode url="dummyhome.aspx">
<siteMapNode url="SectionA/Section1.aspx#" ... roles="user1,user2">
<siteMapNode url="SectionA/Section1.aspx" ...>
<siteMapNode url="SectionA/Section2.aspx" ...>
<siteMapNode url="SectionA/Section21.aspx" ...>
<siteMapNode url="SectionA/Section22.aspx" ...>
...
</siteMapNode>
<siteMapNode url="SectionB/Section1.aspx#" ... roles="user1">
<siteMapNode url="SectionB/Section1.aspx" ...>
....
</siteMapNode>

SectionA has own selected node (last visited), SectionB - own and so
on... - I use session array for this.

BUT - the problem is when i want press sectionA (sectionB ...) picture
and want imitate clicking on last-visited subnode of this section - i
can't do it simply! I hoped on some method of treenode, but there's
only FindNode, that for some reason works with ValuePath, not
DataPath.
I'd prefer to use DataPath because it's also unique and more
understandable for user... and ValuePath is generated by system and I
don't know what is ValuePath for each specific node :( Indicating URL
would be much more easy for the user editing first-to-show nodes in
web.sitemap
 
A

alexandis

Ok, i may set ValueField="Url", but then ValuePath gathers all urls
from all parents! What for, if url is unique across whole menu! :(
Very strange...
So, most likely i need to put own method FindNodeByUrl...
 
A

alexandis

Well, I'm the fastest one :)
I'm already writing my own FindByUrl recursive function. But how to
loop via ALL treeview nodes, ignoring collapsing?
When I use childNodes and some group is collapsed it considers there
are no child nodes there, but it's not true, I need to check ALL nodes
and I do not want to expand them programmatically, because if i don't
find some node url i don't want to have fully expanded list and close
everything back... :(
 

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