Binding a Business object to a datagrid with multiple levels

  • Thread starter Thread starter Liam Ponder
  • Start date Start date
L

Liam Ponder

I have a arraylist of workorders that I can bind to the
datasource of a datagrid. However, each workorder has a
building object that has properties as well. How can I
access these subproperties of the building object in the
datagrid?


I can access these single level fields easily

Workorder.Description


but how do I access sub fields??

Workorder.Building.Description
 
Try this:

TextBox1.DataBindings.Add("Text", Workorder.Building, "Description")
 

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

Back
Top