DisplayMember and DataRelation problem

  • Thread starter Thread starter Sébastien
  • Start date Start date
S

Sébastien

Hi,

I try to figure out how I can set my DataMember so I can do something like
ListBox.DisplayMember =
"Table.RelationName.AnotherParentTableOfMyRelation.StringField"

As my DataSource need to be set to DataSet.DefaultViewManager and I can't
change it (else way my databinding won't work as expected), I would like to
know if there is anyway for me to do what I want to do. In fact, what I am
trying to do is To show info of my first parent table, and all related
information in another parent table (so it is a many-to-many relation with a
middle table). I want my ListBox to show only the record of the second table
that match the current record in my first table.

Thank you for your help.
 
I'm fairly new to this stuff Sebastien, but maybe I can at least point you
in the right direction...
Check out the .GetParentRow method. When you change rows in your Parent2
table, you get a row on your middle child table. Use that child row to call
..GetParentRow("<Parent1DataRelationName>") which will return you a datarow
that you can use to fill in your bound controls.

I hate it when I get answers that are too general, but its the best I can do
at present.

Hope its some help,
Blake
 
Back
Top