|
Rank: Member Groups: Member
Joined: 12/29/2008 Posts: 29
|
Hello, I like to link an object to an EO.Web.TreeNode element. DataItem is read only. And I need more than a simple string, it's a complex object. Is there any was to do so? I need the reference to this object when a node is selected. Best regards, Roger
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
You will not be able to do that. The TreeNode object is automatically reconstructed based on view state during post back. Our control would not know how to reconstruct your data object.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 12/29/2008 Posts: 29
|
There is no need to reconstruct the object. The object is stored in the session state. I only need a way to link it to a node. Example: Each node represents a Mangager inside an organization. I have an object that contains all information about the manager hinself and his organizational unit. So I need something like: TManager aManager = new TManager("John Doe"); aNode.data = aManager;
Any chance to do so?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
No. Even if you store your object in session state, we would still need to save and reconstruct a "reference to your object", which again the TreeNode would not know how to do. If you are already saving the object in session state, you can assign each object a unique string id and then let the TreeNode to save/restore that string ID for you. You can then use the string ID to locate your object.
Thanks
|
|
Rank: Member Groups: Member
Joined: 12/29/2008 Posts: 29
|
OK, thanks for your quick reply! Have a nice weekend
|
|