Welcome Guest Search | Active Topics | Sign In | Register

Populating data with tree view Options
Paulo Mondragon
Posted: Thursday, October 30, 2008 1:34:31 PM
Rank: Advanced Member
Groups: Member

Joined: 6/4/2008
Posts: 38
Hello,

I want a tree view to load infrormation of a data base. I want to do the same as working with the menu control, having a main header (main directory) and submenus (folders or files).
Is it possible to to this ?

Thanks a lot.
eo_support
Posted: Thursday, October 30, 2008 1:47:57 PM
Rank: Administration
Groups: Administration

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

There is no difference when populating to the menu or to the TreeView. They are exactly the same when it comes to data binding.

Thanks!
Paulo Mondragon
Posted: Thursday, October 30, 2008 3:55:08 PM
Rank: Advanced Member
Groups: Member

Joined: 6/4/2008
Posts: 38
I already made this work as the menu control. Now I want to get the Id of the checked nodes with GetCheckedNodes, but I don't know how to do this. I tried to put them in a list box by using databind, but nothing is displayed. My database has an Id, but I don't show it in the text displayed on the TreeView control, I want to get my internal Id of thw checked items.
For example, my DB is like this:

ID TEXT
1 Articulo 1
2 Articulo 2
3 Articulo 3
4 Articulo 4


I displayed the field TEXT but I want to get the field ID of the checked box text, is possible to do this ?

Another issue, is when I check a "father" node all the children gets checked, but when I uncheck the father the children do not get unchecked. Its posible to do this ?

Thanks a lot for your support.
eo_support
Posted: Thursday, October 30, 2008 4:20:54 PM
Rank: Administration
Groups: Administration

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

You would simply use a DataBinding object to map the ID to the TreeNode's Value property. That way each TreeNode displays your TEXT field, but keeps the corresponding ID field value in its Value property. On the server side you would then check each node's Value property to get your internal ID.

As for the second question, you need to set the TreeView's AutoCheckChildren to false.

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.