Welcome Guest Search | Active Topics | Sign In | Register

Select a TreeView item programmatically with SaveStateCrossPages=true Options
RalphElsaesser
Posted: Monday, October 5, 2009 11:57:32 AM
Rank: Member
Groups: Member

Joined: 5/12/2009
Posts: 20
I am using a eoTreeView on a MasterPage and SaveStateCrossPages=true to automatically reselect the last selected node. On the other hand I allow the user to use navigation buttons on the content page, so the selected Node do no longer correspond to the visible content page. Thus I am trying to select the corresponding node programmatically by calling a MasterPage function.

But: It seems that the SaveStateCrossPages-bound reselection of the last selected item is dominant, so programmatical selection seems to be impossible. I am calling the function at the end of the contentpage's PageLoad handler.

How can I implement it?
Can I write this information to the StateCookie? If yes, how can I do it? Is there another/ a better solution?

Thanks!
eo_support
Posted: Monday, October 5, 2009 9:26:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try to set the selected node inside PreRender instead of Page_Load. The idea is to set it as late as possible. Also you may want to deselect the previous selected node first. Consider the following scenario:

Root
- Child 1 -> Page1.aspx
- Child 2 -> Page2.aspx

Selecting "Child 2" will navigate to Page2.aspx, which in turn automatically select "Child 2" when the page loads. If you try to select "Root" in your code it will not work. This is because if you have a parent node and a child node selected at the same time, the child node will have priority (selecting multiple sibling items at the same do work, such as selecting "Child 1" and "Child 2" at the same time). Thus if you wish to select "Root" while "Child 2" is already selected, you will need to unselect Child 2 first.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.