PC Review


Reply
Thread Tools Rate Thread

Data Binding nodes in TreeView

 
 
bg_ie@yahoo.com
Guest
Posts: n/a
 
      2nd Apr 2007
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.

 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      2nd Apr 2007
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.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Grant Frisken
Guest
Posts: n/a
 
      3rd Apr 2007
On Apr 2, 10:35 pm, b...@yahoo.com wrote:
>
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net Treeview data binding update Jeff Gao Microsoft ASP .NET 0 6th Mar 2008 08:36 PM
Data Binding Treeview checkboxes J Microsoft Dot NET 0 22nd Jul 2006 08:15 PM
Exemple needed to reorganize nodes(treeview) with mouse (change Nodes order) Marc R. Microsoft VB .NET 4 2nd Feb 2006 07:58 PM
Displaying Xml data in Treeview & AfterSelecting nodes display data in RichTextBox Guest Microsoft Dot NET 0 20th May 2005 08:13 AM
nodes and data in a treeview Brian Henry Microsoft VB .NET 5 18th Jan 2004 04:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:15 AM.