somebody must know this

L

Lerp

Hi all,

I thought I has solved this earlier but was wrong.

Say I have 2 tables CUSTOMER and ORDER in a related dataset based on
customerid and I would like to display the customer's lastname along with
the ordertitle and orderdate all on one row then iterate through to the next
row.
The customer name comes from the CUSTOMER table and the other two fields
come from the ORDER table.

Also, say I have a one to many relation between the 2 tables : a CUSTOMER
can have one or more ORDER records.

I have tried writing a sub that is called onItemdataBound event of the
datagrid to substitute the values. Is this the normal way to do this?


Thank you for your help, Lerp
 
J

Jim Corey

You could create a new DataTable and populate it by iterating through
the customer and order datatables to get values as needed.

Then bind this new datatable to the datagrid.

This would make it possible to show customername, ordertitle, and
orderdate on one line,
then only ordertitle and orderdate on subsequent lines until you got to
the next customer.

Jim
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top