Databinding problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I thought I had this figured out, but apparently I did not.

I have a list of objects, lets just use Person as an example. The list implements IBindingList. One of the properties of the object is Address, which is an Address object.

Binding the list of Person objects to a datagrid produces the anticipated results, each of them shows as a row in the grid. You can even click the 'plus' and navigate to the Address object. Great. What I want to do though is to show JUST the addresses in the list. I don't want to see the individual information at all, just the addresses corresponding to the individuals.

What I tried was:

binding = new Binding("Datasource", personList, "Address")
Grid.Databindings.Add(binding)

Unfortunately, what this does is show the ONE address of the current Person. Which is great if there is only one Person in the list, but if there are more than one it only shows a single address. So how do I do what I want?
 

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