Welcome Guest Search | Active Topics | Sign In | Register

Populate TreeView Options
Konrad Krupa
Posted: Tuesday, May 27, 2008 8:16:42 PM
Rank: Newbie
Groups: Member

Joined: 5/27/2008
Posts: 2
I just downloaded the trial version of your components and they are very impressive.
I'm having problem populating Tree View nodes dynamically.

I access WebService to get the data from the database and when clicking on tree node I need to go to the WebService and get the children for the node.

How do I detect the click on the node and then populate the children?

konrad.d'oh!
eo_support
Posted: Wednesday, May 28, 2008 4:11:38 AM
Rank: Administration
Groups: Administration

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

There are two ways to do it. One is by handling ItemClick event, the other is by handling ItemPopulate event. For both events e.TreeNode contains the clicked node.

In order to populate the children, you just create a new node and add it to the parent node's Nodes collection:

Code: C#
EO.Web.Node child = new EO.Web.Node();
child.Text = "node text";
parent.Nodes.Add(child);


You can find more sample code in the sample project, which is installed on your machine in the form of Visual Studio projects when you install our product.

Thanks
Konrad Krupa
Posted: Wednesday, May 28, 2008 4:46:46 AM
Rank: Newbie
Groups: Member

Joined: 5/27/2008
Posts: 2
I can add the node to the tree but I can't catch any event when I click on the node.

I tried several events and I can't seem to catch any of them.

When I use ItemClick event it doesn't get fired.

Konrad.
eo_support
Posted: Wednesday, May 28, 2008 7:36:49 AM
Rank: Administration
Groups: Administration

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

You will need to set the TreeView's RaisesServerEvent to true.

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.