J
Jan Nielsen
Hi
I have a dataset that is bound to a combo on 1 form and a datagrid on
another form. I would like the combo and the datagrid to be disconnected.
It is like this.
I have a Main form with a "Send-Email-To-SelectedGroup-combo". When a group
is selected an email is generated to all members of the group.
The combo is a general combo (not in sync with rest of Main form)
If a person wants to add a new group to the combo I open a new form with a
datagrid showing all the groups. I send the dataset from the Main form to
the Add new group form
I send the dataset like this:
Sub OpenAddGroupForm
Dim frm As New FrmAddGroup()
frm.AssignDataset(Me.DsBoerneKirken1)
frm.ShowDialog()
End sub
The form AddGroupForm has a typed dataset as a local variable
Public Class AddGroupForm
Dim dsBoernekirkenAddGroup As Boernekirken_VB.DSBoerneKirken
Sub AssignDataset (byval inputDS as Boernekirken_VB.DSBoerneKirken)
dsBoernekirkenAddGroup = inputDS
End sub
sub AddGroupForm_Load
Datagrid.Datasource = dsBoernekirkenAddGroup
End sub
OR
Sub AddGroupForm_Load
Datagrid.Datasource = dsBoernekirkenAddGroup.TblAllowedGroup
End sub
OR
Sub AddGroupForm_Load
Datagrid.Datasource = dsBoernekirkenAddGroup
Datagrid..DataMember = "TblAllowedGroup"
End sub
Now THE PROBLEM:
Depending of which of the Loads I use When I
1) Sort on the columns in the datagrid or
2) delete or add new records to the datagrid the
"Send-Email-To-SelectedGroup-combo" on the MAIN form receives an
SelectedIndexChanged event so it sends an email (to a random group it seems)
How can I disconnect the combo on the main form from what happens in the
datagrid in the AddGroup form when they are bound to the same dataset?
Best regards
Jan
I have a dataset that is bound to a combo on 1 form and a datagrid on
another form. I would like the combo and the datagrid to be disconnected.
It is like this.
I have a Main form with a "Send-Email-To-SelectedGroup-combo". When a group
is selected an email is generated to all members of the group.
The combo is a general combo (not in sync with rest of Main form)
If a person wants to add a new group to the combo I open a new form with a
datagrid showing all the groups. I send the dataset from the Main form to
the Add new group form
I send the dataset like this:
Sub OpenAddGroupForm
Dim frm As New FrmAddGroup()
frm.AssignDataset(Me.DsBoerneKirken1)
frm.ShowDialog()
End sub
The form AddGroupForm has a typed dataset as a local variable
Public Class AddGroupForm
Dim dsBoernekirkenAddGroup As Boernekirken_VB.DSBoerneKirken
Sub AssignDataset (byval inputDS as Boernekirken_VB.DSBoerneKirken)
dsBoernekirkenAddGroup = inputDS
End sub
sub AddGroupForm_Load
Datagrid.Datasource = dsBoernekirkenAddGroup
End sub
OR
Sub AddGroupForm_Load
Datagrid.Datasource = dsBoernekirkenAddGroup.TblAllowedGroup
End sub
OR
Sub AddGroupForm_Load
Datagrid.Datasource = dsBoernekirkenAddGroup
Datagrid..DataMember = "TblAllowedGroup"
End sub
Now THE PROBLEM:
Depending of which of the Loads I use When I
1) Sort on the columns in the datagrid or
2) delete or add new records to the datagrid the
"Send-Email-To-SelectedGroup-combo" on the MAIN form receives an
SelectedIndexChanged event so it sends an email (to a random group it seems)
How can I disconnect the combo on the main form from what happens in the
datagrid in the AddGroup form when they are bound to the same dataset?
Best regards
Jan