Welcome Guest Search | Active Topics | Sign In | Register

TreeView inside a TabStrip issue. Options
Bazooka
Posted: Friday, May 4, 2012 1:53:10 PM
Rank: Advanced Member
Groups: Member

Joined: 7/3/2009
Posts: 37
I have two tabs and inside of tab-1(has it's own .ascx) which has a EO treeview object-populated on demand with references the data from Folder XYZ from the file system just like your populated on demand example. No issues there. Now in tab-2(has it's own .ascx) I also has a EO treeview object-populated on demand with references the data from the file system on a diffrent folder ABC.

Once the page loads the tab-1 is loaded by default and the tree view loads correctly with folder XYZ, but know when I select tab-2 the tree view object displays the incorrect contents of folder XYZ and not folder ABC that is called from MyTree_ItemPopulate method. It's like dublicating the folder contents of folder XYZ into the tab-2's treeview object. No errors are generated. The only way I can force the tab-2's tab/folder to generate the correct folder's ABC contents is to peform a mytree.DataBind() on the treeview object. Now is this possible to do a populate on demand from a mytree.datasource?

Why is this duplication is happening since I can post different html objects into each tabs(.ascx) and get different independent results but the treeview object only displays the correct Text="my folder text" but not the folder ABC contents from tab-2's MyTree_ItemPopulate method?

I'm I missing something? Thanks.


I'm using 8.0.15.2 EO version.



Inside a .asxc file:
<eo:TreeView runat="server" id="TV_Plans" AutoSelect="ItemClick" ControlSkinID="None" Width="375px" Height="200px">
<TopGroup Style-CssText="border-bottom-color:#ffffff;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#ffffff;border-left-style:solid;border-left-width:1px;border-right-color:#ffffff;border-right-style:solid;border-right-width:1px;border-top-color:#ffffff;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Calibri;font-size:10pt;padding-bottom:2px;padding-left:2px;padding-right:2px;padding-top:2px;">
<Nodes>
<eo:TreeNode PopulateOnDemand="True" RaisesServerEvent="True" Text="Health Plans"></eo:TreeNode>
</Nodes>
</TopGroup>
<LookNodes>
<eo:TreeNode ImageUrl="00030203" DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;color:Gray;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;"
CollapsedImageUrl="00030301" ItemID="_Default" NormalStyle-CssText="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; COLOR: black; BORDER-TOP-STYLE: none; PADDING-TOP: 1px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none"
ExpandedImageUrl="00030302" SelectedStyle-CssText="background-color:#316ac5;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:White;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;"></eo:TreeNode>
</LookNodes>
</eo:TreeView>
eo_support
Posted: Friday, May 4, 2012 2:15:10 PM
Rank: Administration
Groups: Administration

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

This almost certainly has to do with the code that dynamically load the ascx tab page. ASP.NET uses the full "path" to identify a control during post back and if one control is loaded at the same location in the control tree of another control, it could get the other control's view state data. When that happens, your controls will have an identify issue.

To resolve this issue, structure your controls tree in such a way so that this won't happen. For example, the following control tree can have problem:

Original Tree (-> means parent child relationship):
Code:
A -> B -> X

Post back Tree:
Code:
A -> B -> Y


This can have problem because Y can get mixed up with X.

The following structure won't have problem:

Code:
A -> B -> C -> X
       -> D


Post back:
Code:
A -> B -> C
       -> D -> Y


Y in the second tree won't be mixed with X in the first tree.

Hope this helps.

Thanks!
Bazooka
Posted: Monday, May 7, 2012 11:04:54 AM
Rank: Advanced Member
Groups: Member

Joined: 7/3/2009
Posts: 37
Thanks, I figured it out. I tried posting each dynamic usercontrol on every pageload on the page_load and page_init methods but it still didn't work.

What I did is assign the name of the usercontrol based on a tap selection to a ViewState value in the LoadControl method and it worked. I also assigned a unique Id to each different control. I hope this helps someone.


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.