0

i have 2 tables one holds and id number for a transaction and the other tables holds the data for that transaction
i can populate the first datagridview with the "id" data.
I want to be able to select the row on the datagridview (id) and show the details for that transaction in another table

Me.Tbl_Transactions_HeaderTableAdapter.ClearBeforeFill = True
Me.Tbl_Transactions_HeaderTableAdapter.Fill(Me.DataSet_Sys.tbl_Transactions_Header)
Me.Tbl_Transactions_HeaderDataGridView.Refresh()

this populates the datagridview with the "id" data, how do i then click on a row and the details show in another datagridview.
if i add the code for the transaction data on form load, then it populates all the tranasction data into the
2nd table

 Me.Tbl_TransactionsTableAdapter.ClearBeforeFill = True
 Me.Tbl_TransactionsTableAdapter.Fill(Me.DataSet_Sys.tbl_Transactions)
 Me.Tbl_TransactionsDataGridView.Refresh()
2
Contributors
3
Replies
24
Views
3 Years
Discussion Span
Last Post by PerplexedB
0

Instead of filling the detail tableadapter in the load event of the form, you could do that in the "RowEnter" event of the header datagridview.

You need to pass the key to the detail tableadapter. You will find the the key in DataGridView.CurrentRow.Cells("keyfiedColumnName").value.

Let us know if you need help on how to pass the key to the detail adapter.

Good luck.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.