How select in either grids in 'Master-Slave' ?

J

Jan

Hi,

I have two datagrids on a form. Datagrid 1 shows 'customers'. Datagrid 2
shows the 'orders' belonging to 'customers'.

When I select a customer in Datagrid 1, I should automatically get all
orders related to this customer in Datagrid 2. (=standard Master-Slave)

But I would also like to have the possibility to start with the selection of
an order in Datagrid 2 and to automatically get the related Customer
selected in datagrid 1. This means I need the complete list of orders to be
available in datagrid 2.

Questions
========
1. One possibility is to add a 'dummy customer' to datagrid 1 called
"Display ALL orders". Any other approaches ? Suggestions ?

2. What is the most efficient way to implement this ? I guess using the
standard master-slave solution : "2 grids bound to the datatables and a
datarelation between the two datatables" is not possible due to the "ALL
orders" entry in datagrid 1. Any suggestions would be appreciated.

Thanks,
Jan
 
S

Steven Bras [MS]

My recommendation: find a way to use a separate interface for the "display
all" functionality, which really only requires one grid. Use another form,
or a different set of controls on that form, that changes dynamically based
on the user's input into a checkbox or other control.

Trying to dummy up the relationship would mean adding a row to the parent
table in your database, with relations to every row in the child table.
Maintaining this would be cumbersome, and I know of no other way to do it
using bound grids and datarelations.

Steven Bras, MCSD
Microsoft Developer Support/Data Access Technologies

This posting is provided "AS IS" with no warranties, and confers no rights.

Microsoft Security Announcement: Have you installed the patch for Microsoft
Security Bulletin MS03-026?  If not Microsoft strongly advises you to
review the information at the following link regarding Microsoft Security
Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026.
 

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