Welcome Guest Search | Active Topics | Sign In | Register

Treeview Checkboxes and Expansion Options
Ian Kelly
Posted: Friday, February 25, 2011 2:14:18 PM
Rank: Member
Groups: Member

Joined: 1/21/2011
Posts: 11
Hi There,
I am trying to do something that I think should be very simple but can't seem to get it to work.

1) I have a dataset with three fields Company Type, Company Name, Contact.
2) I want to build a treeview with this data and have checkboxes ONLY on the Company Name level.
3) I want the treeview to have the first level expanded when loaded (i.e. You see the types and all companies for those types but not the contacts for the individual companies.)

I can turn on check boxes on or off for all levels but not for just the second level. Do I need to do something in the load event of the form to get the treeview to expand or is there a setting on the treeview that I am missing?

Thanks
Ian
eo_support
Posted: Friday, February 25, 2011 3:46:56 PM
Rank: Administration
Groups: Administration

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

You can not have checkboxes just on one level. It's either on or off on all levels.

You can expand a node by setting the node's Expanded to true.

Thanks!
Ian Kelly
Posted: Friday, February 25, 2011 4:24:38 PM
Rank: Member
Groups: Member

Joined: 1/21/2011
Posts: 11
That's a little disappointing. It would definitely bee a nice feature to have. I found in an earlier post (http://www.essentialobjects.com/forum/postst1683_Disable-checkbox.aspx) the suggestion to add a checkbox to a nodes text property. This might work. Is there a way to link such a checkbox to the treeview so I would be able to tell what node a particular checkbox is associated with?
eo_support
Posted: Friday, February 25, 2011 4:30:32 PM
Rank: Administration
Groups: Administration

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

The information in that link is correct. While it is technical doable, we have no plan to build that into the TreeView though due to the complexity of the feature and the fact that only a very small number of people are interested in such a feature.

Thanks!
Ben Switzer
Posted: Thursday, March 10, 2011 11:16:09 AM
Rank: Advanced Member
Groups: Member

Joined: 5/30/2007
Posts: 30
I have done something like this before. Loop through the tree turning on the nodes you want on.

TreeView1.Nodes(i).ShowCheckBox = EO.Web.NullableBool.True

Perhaps some code to only set true on nodes that have Both a parent node and a child node.


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.