J
Jeremiah Harbottle
Hi,
Using VC to write a small app that displays data extracted from a database
into a typed DataSet. That all works fine.
I have three tables - Parent, Child, and then each record in the Child table
also has children.
I want three grids - one for each table:
A. Parent (ParentID is key)
B. Child (ChildID is key, FK to ParentID)
C. GrandChild (GCID is key, FK to ChildID)
So, when the user selects a parent, the child grid shows the correct
records. Subsequently, selecting a child row should show the grandchildren
records for that row.
I've set up all the datarelations correctly and used the DataSource,
DataMember on the grid.
GridA - DataSource = myDataset
DataMember = ParentTable
GridB - DataSource = myDataSet
DataMember = ParentChildRelation
GridB - Datasource = myDataSet
DataMember = myChildGCRelation
Selecting a record in A causes B to only shows those with the correct FK.
Brilliant. Adding a new record fills in the FK column with the correct
value. Splendid!
However, it doesn't work with the Child/Grandchild tables? The GrandChild
grid always shows the same record...
Can .Net handle this? Am I doing something wrong?
Regards,
JH
Using VC to write a small app that displays data extracted from a database
into a typed DataSet. That all works fine.
I have three tables - Parent, Child, and then each record in the Child table
also has children.
I want three grids - one for each table:
A. Parent (ParentID is key)
B. Child (ChildID is key, FK to ParentID)
C. GrandChild (GCID is key, FK to ChildID)
So, when the user selects a parent, the child grid shows the correct
records. Subsequently, selecting a child row should show the grandchildren
records for that row.
I've set up all the datarelations correctly and used the DataSource,
DataMember on the grid.
GridA - DataSource = myDataset
DataMember = ParentTable
GridB - DataSource = myDataSet
DataMember = ParentChildRelation
GridB - Datasource = myDataSet
DataMember = myChildGCRelation
Selecting a record in A causes B to only shows those with the correct FK.
Brilliant. Adding a new record fills in the FK column with the correct
value. Splendid!
However, it doesn't work with the Child/Grandchild tables? The GrandChild
grid always shows the same record...
Can .Net handle this? Am I doing something wrong?
Regards,
JH