CurrencyManager Position in child table

M

Matthew Marsh

I have a simple master/detail application showing companies and related
contact names.
I have created a relationship between the two tables (named Company &
Contact) using the Dataset XML Schema designer.

Using the CurrencyManager.Position property I can obtain the position of the
current record for both the Company and Contact tables as two separate
tables, but this does not give me the position of the Contact table as part
of the parent/child relationship.

For example, using the following sample data

Company List Box
--------------------
Western Farms

Contact List Box
------------------
Andrew
Peter

Lets assume we only have 1 company and 2 contacts (both belonging to the
same company) -

we select "Western Farms" from the Company list box
then we select "Peter" from Contact list box.

At this point the currency manager provides this information-
Company - Position = 0
Contact - Position = 0

The position for the Contact (Peter) should be 1.
The currency manager has not taken into account that the Contact table is
part of a relationship.

Can anyone please help with this.

Many thanks
Matthew
 
K

Kathleen Dollard

Mathew,

Hard to guess without knowing how things are bound. Can you give us that
information?

Kathleen
 
M

Matthew Marsh

I got sorted with this-

int childPosition =
this.BindingContext[dataSet11.Tables["Company"],"CompanyContact"].Position;

Thanks anyway.

Matthew
 

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

Top