By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

Detecting real changes in a bound datagrid

P: n/a
Hi,
I need to determine when data in a datagrid bound to a dataset has changed and thus make
updates accordingly.

I would of thought the code below would detect when a change has been made to the dataset, however
the haschanges value is set to true even if i just click on a cell without changing anything. is there anyway of
telling if anything has actually really changed on the bound grid. I need to know when an actual changes are made, not just when the
user has clicked on a cell.
thank you
David

The code:

datagrid1.datasource = customerdataset1.tables!customers
private sub datagrid1_currentcellchanged(etc....)

If customersDataSet1.HasChanges Then
MsgBox("dataset has changed")

End If

end sub
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Cor
Hi David,

Add this before the check for changes

DirectCast(BindingContext(customerDataset1!custome rs),
CurrencyManager).EndCurrentEdit()
If customersDataSet1.HasChanges Then
MsgBox("dataset has changed")


Now that this event not fired when you leave the datagrid or close the
program.

I hope this helps?

Cor
Nov 20 '05 #2

P: n/a
Cor
Know
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.