display columns from 2 different tables in the same datagrid

G

Guest

Hello,

I need to display 2 tables in the same datagrid.
I've been playing with this http://support.microsoft.com/kb/319076/EN-US/
which works great except for a few things:
- I know no way to format the displayed data (I have some datetime columns)
- sorting does not work either
- I can't replace null values with what I want

I would like to avoid the hassle of merging my 2 datatables into a 3rd one
and then displaying it. Any changes in this datatable I will have to manually
update my 2 original datatables.

Eventually I have to implement this on a WinCE device so I'm also concerned
with performance issues.

This seems like a common issue (having IDs + data in one table and the
matching description + ID in another table and needing to display the
description + data itself) but I haven't found anything good but this MS
article.

Anyone has any ideas on how to achieve this?

Thanks,
Sitar.
 
D

DalePres

You don't say what your data source is but if it is SQL Server then you can
create a View to give you the data you want to display in one table and can
update it as well, as long as the rules for updating Views are followed.

DalePres
MCAD, MCDBA, MCSE
 
G

Guest

My datagrid's datasource is a dataset containing 2 tables.
The data source is SQL Server or SQL Server CE. My application has to
run on both Desktop and Mobile environment.

If I get it right you suggest that I pull the data from a SQL Server view
(with columns fitting my needs). This data will be hosted inside a dataset
that
I bind to my datagrid.

Now let's say I add/delete/modify some rows. When I call dataatapter.Update()
on this dataset, it will update the view and consequently the tables behind
the view? Sounds like magic. Could you please give me some more details
on this or point me somewhere where I could find it?

Thanks,
Sitar.
 
G

Guest

Thanks DalePres for the info. My DBA was interested more than I was
unfortunately :)
I can't use this approach as it will not work on Sql Server CE.

I'm still looking for a great way to do what I want, but for now I'll
construct a temp datatable for display purpose. It's not exactly what I want
in terms of performance though.

Sitar.
 

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