changing BindingManagerBase.Positions cause DataSet.HasChanges=true

F

Franco Caloni

Hi all,
I'm developing my first application, I'm creating a form to manage records
from a SQLCE table.
I'm binding the form's controls (textboxes) to a filled datatable. On the
form there are buttons to navigate records setting the
bindingmanagerbase.position to the proper value.
This works and I can scroll the table's records on the form.
But I have noticed that after changed the bindingmanagerbase.position the
form display the correct values, but Dataset.HasChanges always return true
even if I don't have changed any value on the textboxes.
Because I'm novice, I'm asking if this is this the correct behavior when
binding controls, and why this happens?
If I don't change the textbox's values I expect that the dataset.haschanges
return false....
Thanks for any explanations.

Franco
 
I

Ilya Tumanov [MS]

As you change the position, current values are submitted to the data source
before new values are shown.

That's considered a change even though values are the same.



It's like loading and saving a file. You've made no changes, but time stamp
on a file has been updated.



You should be able to add a handler to PositionChanged event and
RejectChanges() as needed.



Best regards,



Ilya



This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top