DataGridView & DataSet with Parameters

markross

Member
Joined
Jun 28, 2008
Messages
9
Programming Experience
Beginner
Using DataSets, DataAdaptors and BindingSources

I have 3 DataGrids with 3 Tables with relationships
table-1 is a 1-many relation to table-2
table-1 is a 1-many relation to table-3

here's the twist, table-2 has a relationship with nulls on table-3, so that table-3 always has the id of table-1 but the id of table-2 is optional (id or <null>).

Dataset - table-3 has an extra fillby method that seams to work, at the data level anyway.

GV-1 (table-1) and GV-2 (table2) works fine.
GV-3 worked ok but wouldn't filter when there was revlevent rows in table-2, so I added code.

If gv-2.RowCount > 1 Then
3-TableAdapter.FillBy(Ds.tbl-3, gv-2.CurrentRow.Cells(0).Value)
Else
3-TableAdapter.Fill(Ds.tbl-3)
End If
3-BindingSource.ResetBindings(False)
I renamed things to make more sence (they arn't call 1 2 & 3)

If I create a button to update gv-3, it works ok, but when trying to enter data in gridview-3, it goes spacko and dosn't redraw properly or gereates a datakey error.
I expect there is a problem with data binding, but I'm a bit lost


Thanks in advance
 
I have found the answer, it was my gv.RowValidated event, it seems to mess-up my datagrids when using them to save data

Thanks
 
Back
Top