Data Binding nodes in TreeView

B

bg_ie

Hi,

I have a tree view which contains a number of nodes which correspond
to a set of objects, as follows -

class Address
{
int postCode;
sting[2] abbreviation;
}

class Person
{
string[] name;
Addressaddress;
}

Person[2] person;

TreeView:

+ Name: Barry
+ Address: BH 91001

+ Name: John
+ Address: CL 11002

I'd like to be able to click on a node in my treeview and then edit
its value. To bind to a testbox you can do something like this -

textBox1.DataBindings.Add(new Binding("Text", person[0], "State"));

but what about a Node in a text field?

Any suggestions,

Thanks,

Barry.
 
N

Nicholas Paldino [.NET/C# MVP]

Barry,

Unfortunately, there is no Bindings property to do this with. You will
have to set the values (or a class to do it) manually.
 
G

Grant Frisken

I'd like to be able to click on a node in mytreeviewand then edit
its value. To bind to a testbox you can do something like this -

textBox1.DataBindings.Add(new Binding("Text", person[0], "State"));

but what about a Node in a text field?

If you want a Tree control that supports data binding (with a lot of
flexibility) then have a look at Infralution's Virtual Tree. You can
get more information and download an evaluation copy from:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top