Databind to a single instance of a class

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I've seen plenty of examples where you can databind to a list of objects,
but in this case I want to bind to a single instance and have no use for a
list. Can anyone refer a good example of how to do this in .net 2.0?

Thanks.
 
It depends on what control you want to use for databinding?

If you want to bind a text box to a single property of an object, you
can do something like this:

MyTextBox.DataBindings.Add( "Text", person, "FirstName" );

That will bind the object person's FirstName property to the Text
property of the textbox.

HTH
Andy
 
Back
Top