|
-
Oct 4th, 2007, 01:55 PM
#1
Thread Starter
Fanatic Member
How to do Dataset Changes
I have a bindingsource called persDataBindingSource it is filled with personnel records and on the top of my form I have several textboxes that are bound to that bindingsource. I have a bindingnavigator that allows me to step through the bindingsource. I have another binding source (claimsBindingSource) that is filtered by the persons id selected in the top bindingsource and a dataset (dsClaims). ON my form I have a datagridview with its datasource set to claimsBindingSource. I also have textboxs, combos, datetimepickers, etc that correspond to one row on the datagridview and they are bound to the bindingsource too. If I move through the datagridview, the controls follow along. If I make a change to a row in the datagridview and then move to the next persons record, it fires this code:
Code:
private void persDataBindingSource_PositionChanged(object sender, EventArgs e)
{
if (dsClaims.HasChanges() || intChange == 1)
{
DialogResult result = MessageBox.Show("You have made changes, do you wish to save them?", "Save changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (result == DialogResult.Yes)
{
Validate();
claimsBindingSource.EndEdit();
this.claimsTableAdapter.Update(dsClaims.Claims);
intChange = 0;
}
else
{
intChange = 0;
}
}
}
If I make the change in the datagrid, I get prompted to save the change. IF I make the change in the textbox of the same column, it moves to the next record without being prompted. Anyone know why and how I can get it to ask? I have been trying to fix this all week with no progress. All help will be greatly appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|