Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Master child sub-child binding on 2 forms
 

Master child sub-child binding on 2 forms

Hi - I have a form with dataset with three table relationships. Table1 (master) on to many to Table2. Then Table2 is a master to Table3. I created the bindings just fine and if I have 3 datagridviews on the same form things work fine. However, I want to show table1 and table 2 on one form and then have the user click Edit to show table3 in a new form. I still want any changes to table3 to be relected in my main dataset.

This is how I am trying to show my new form:

Dim myForm As New FormEditMargins

myForm.StartPosition = FormStartPosition.CenterScreen

myForm.DsImpactTables1 = Me.DsImpactTables1

myForm.BindingSource1.DataSource = Me.DsImpactTables1.ImpactEvent

myForm.BindingSource1.DataMember = "ImpactEvent_ImpactMargin"

myForm.DataGridView1.DataSource = myForm.BindingSource1

myForm.ShowDialog()

End Sub

I get an error saying the ImpactEvent is not in the dataset.

Any ideas would be appreciated.

Scott

ScottL  Friday, November 11, 2005 5:05 PM
I solved it. I have to have an unbound datagridview in form2 and then pass the form1 data binding to form2 and configure the grid in code. I was hoping to be able to bind form2 for formating the grid, but it looks like that will not work. I have a small code example if anyone wants to see it.
ScottL  Friday, November 11, 2005 8:13 PM
I solved it. I have to have an unbound datagridview in form2 and then pass the form1 data binding to form2 and configure the grid in code. I was hoping to be able to bind form2 for formating the grid, but it looks like that will not work. I have a small code example if anyone wants to see it.
ScottL  Friday, November 11, 2005 8:13 PM

You can use google to search for other answers

Custom Search

More Threads

• OnValidating event not firing in DataGridView
• AddNew dont work...(for me at least)
• Merge a particular column header in DataGridView C#
• BindingSource bound controls
• Two DataGrid And Sorting Problem
• BindingSource cannot be its own data source
• SQLException
• DataGridView bound to Filtered BindingSource is extremely slow
• Inherit from DataGridViewLinkCell - Editing control doesn't appear
• ContextSwitchDeadlock Was Detected