Using 2 DataGrids

G

Guest

I am looking for working examples of making use or 2 datagrids and one dataset

Grid 1 master Display minimul info
Grid 2 slave. Disply detail info

When the user clicks a row on the master I then load Grid 2 with detail information.

Thanks for any help

B
 
B

BB

Hello,

There are a number of examples out there in the VS.NET on-
line help, but here's a pretty good one: *Walkthrough:
Creating a Master-Detail Windows Form*. It uses a
datagrid and a listbox, but the idea is the same.

You build the master/slave datatables, then build the
datarelation. You bind table 1 to datagrid 1
(setbindings), but instead of binding datagrid 2 to the
child table you *bind it to the datarelation*.

For example, table 1 is OrderHeader and table 2 is
OrderDetail. You build the datarelation on OrderID and
name that relation "OrderRelation". Bind datagrid 1
to "OrderHeader" and datagrid 2
to "OrderHeader.OrderRelation", and you're good to go.
If you bind grid 2 to the child table, even with the
relation set, you'll just get two unrelated grids.

One other thing: there's a property on the datagrid
called AllowNavigation. If that's true (default), then
you get plus signs on the parent grid, which you can
expand to view the child details right in the parent
grid. Cool, but can also be annoying--I think like you
that using the two grids is a better approach.

There's also a great book out there, ADO.NET Cookbook
(O'Reilly), that talks about your case in detail, along
with tons of other how-to's that you don't get as simply
from the on-line docs.

hth,

Bill Borg
-----Original Message-----
I am looking for working examples of making use or 2 datagrids and one dataset

Grid 1 master Display minimul info
Grid 2 slave. Disply detail info

When the user clicks a row on the master I then load
Grid 2 with detail information.
 
G

Guest

OK well I tried install the Vb.Net ket but it will not work.

I am using ONE dataset with 2 datagrids. All the data I need is in the one dataset however, one row of data is so long I want to split it up into 2 grids so the user can see all informatiuon without scrolling to the right. I am trying to sync them up.

Thanks
 

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