Find treenode by DataPath, not ValuePath

Find treenode by DataPath, not ValuePath

am 01.02.2008 15:58:07 von 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






...



....


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

Re: Find treenode by DataPath, not ValuePath

am 01.02.2008 16:38:59 von 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...

Re: Find treenode by DataPath, not ValuePath

am 01.02.2008 18:11:54 von 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... :(