M
Manuel Canas
I'm stuck here guys, need some help.
I have a form with a couple fo tabs on it. I load a table in each for each
tab. I populate a listbox with a list of names. Then I use currency manager
to manipulate the datatables.
This is my issue here, whenever I click on a name on the listbox the first
currency manager currentchanged event fires, that works ok. Now I cannot
find a way to pass the current selected item from the first currency manager
to the second one so the data on the second tab would move to the
corresponding record on the dataset.
Maybe I'm not explaning things very clear here, I'try to explain it with
some code below;
I tied the datatables to the currency managers after binding all the
controls on the tabs to the corresponding Data tables.
Currency Manager1 = DirectCast(BindingContext(dtTable1), CurrencyManager)
CurrencyManager2 = DirectCast(BindingContext(dtTable2), CurrencyManager)
Then on the CurrentChanged Event of the first currency manager
Private Sub CurrencyManager1_CurrentChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles CurrencyManager1.CurrentChanged
DisplayTestDetailsTab()
End Sub
Private Sub DisplayTestDetailsTab()
Dim data_row_view As DataRowView
Dim Test_id_filter As String
'get the selected record's Test1
data_row_view = CurrencyManager1.Current()
Test_id_filter = "TestID = " & data_row_view.Item("TestID")
Now Up until here the record moves to the corresponding place on the data
table.
Now on the second tab which is a table, how can I do to display the
information from it's data table. it has a TestID which ties both tables on
a one to one relationship.
Somehow I think I have to pass the currenct item value (TestID) from the
CurrencyManager1 to the CurrencyManager2 in order for the CurrencyManager2
display it's information on the second tab on the form.
Thanks so much for all the inputs on this one.
Manuel.
I have a form with a couple fo tabs on it. I load a table in each for each
tab. I populate a listbox with a list of names. Then I use currency manager
to manipulate the datatables.
This is my issue here, whenever I click on a name on the listbox the first
currency manager currentchanged event fires, that works ok. Now I cannot
find a way to pass the current selected item from the first currency manager
to the second one so the data on the second tab would move to the
corresponding record on the dataset.
Maybe I'm not explaning things very clear here, I'try to explain it with
some code below;
I tied the datatables to the currency managers after binding all the
controls on the tabs to the corresponding Data tables.
Currency Manager1 = DirectCast(BindingContext(dtTable1), CurrencyManager)
CurrencyManager2 = DirectCast(BindingContext(dtTable2), CurrencyManager)
Then on the CurrentChanged Event of the first currency manager
Private Sub CurrencyManager1_CurrentChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles CurrencyManager1.CurrentChanged
DisplayTestDetailsTab()
End Sub
Private Sub DisplayTestDetailsTab()
Dim data_row_view As DataRowView
Dim Test_id_filter As String
'get the selected record's Test1
data_row_view = CurrencyManager1.Current()
Test_id_filter = "TestID = " & data_row_view.Item("TestID")
Now Up until here the record moves to the corresponding place on the data
table.
Now on the second tab which is a table, how can I do to display the
information from it's data table. it has a TestID which ties both tables on
a one to one relationship.
Somehow I think I have to pass the currenct item value (TestID) from the
CurrencyManager1 to the CurrencyManager2 in order for the CurrencyManager2
display it's information on the second tab on the form.
Thanks so much for all the inputs on this one.
Manuel.