G
Guest
Using VB.NET 2003.
I have two tables. One is the master and the other is the detail. I am
successfully binding them both and can successfully bind the detail to a
datagrid and pull in all related detail records to the master. (not really
what I want though)
I have created a user control with the fields from the detail table and
would like to dynamically create tabpages on my tabcontrol so there are as
many tabs as there are detail records corresponding to the master record. I'm
only pasting the code that creates the tabpage and I hope that is enough. The
problem I have is that I need to figure out when / how to call this sub for
every detail record.
Private Sub AddTabPage()
Dim tbPage As New TabPage
Dim ctlMyPage As New CGAAppLibraryTabPage_ctl
ctlMyPage.txtModDesc.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_desc")
ctlMyPage.txtModMigDoc.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_migdoc")
ctlMyPage.txtModSetup.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_setup")
ctlMyPage.cboModType.DataSource = dsAppMaster.app_types
ctlMyPage.cboModType.SelectedItem =
dsAppMaster.Tables("app_master.AppMod.mod_type")
ctlMyPage.cboModType.DisplayMember = "app_type"
tbPage.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_name")
tbPage.Controls.Add(ctlMyPage)
TabControl1.TabPages.Add(tbPage)
End Sub
Any help or direction would be greatly appreciated.
I have two tables. One is the master and the other is the detail. I am
successfully binding them both and can successfully bind the detail to a
datagrid and pull in all related detail records to the master. (not really
what I want though)
I have created a user control with the fields from the detail table and
would like to dynamically create tabpages on my tabcontrol so there are as
many tabs as there are detail records corresponding to the master record. I'm
only pasting the code that creates the tabpage and I hope that is enough. The
problem I have is that I need to figure out when / how to call this sub for
every detail record.
Private Sub AddTabPage()
Dim tbPage As New TabPage
Dim ctlMyPage As New CGAAppLibraryTabPage_ctl
ctlMyPage.txtModDesc.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_desc")
ctlMyPage.txtModMigDoc.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_migdoc")
ctlMyPage.txtModSetup.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_setup")
ctlMyPage.cboModType.DataSource = dsAppMaster.app_types
ctlMyPage.cboModType.SelectedItem =
dsAppMaster.Tables("app_master.AppMod.mod_type")
ctlMyPage.cboModType.DisplayMember = "app_type"
tbPage.DataBindings.Add("Text", dsAppMaster,
"app_master.AppMod.mod_name")
tbPage.Controls.Add(ctlMyPage)
TabControl1.TabPages.Add(tbPage)
End Sub
Any help or direction would be greatly appreciated.