joining two DataTables in one DataGrid

  • Thread starter Emmanuel Touzery
  • Start date
E

Emmanuel Touzery

Hello,

Firstable this is not a server-side ASP application, but a
Windows.Form clientside application.

I have two DataTables with the same key, in the same DataSet, and
connected by this key. I would like to display in a DataGrid columns
from the two DataTables side by side (like a SQL join). eg, columns
from both DataTables in one same row in one DataGrid.

I tried to use a DataGridTableStyle having for the MappingName of
the column either "columnInTheOtherTable",
"otherTableName.columnInTheOtherTable",
"relationName.otherTableName.columnInTheOtherTable", but nothing
works. The extra columns never appears. There is no exception.

I do not want to extend the main DataTable; here's why:

I have a DataTable with various data about let's say a provider. but
in my application there are several types of providers, so I have a
second DataTable with details. Depending on the provider, details are
going to be different.
So i have different "extra" DataTables depending on the provider type,
with different columns.

And I want those details to be displayed with the main data common to
all providers.

any idea?

emmanuel
 

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