Trouble with databinding on a textbox

A

AEgir Sveinsson

Hi,

I am having trouble with the databinding of my textboxes. They display
correctly the data they are getting from the dataset but when I enter a new
value, nothing seems to have changed and the following if statement never
gets true.
if (dataSet1.HasChanges(DataRowState.Modified))

{

MessageBox.Show("Changed");

}

I can't believe that I have to write code to update the dataset with the
textbox values, so what must I do to get this correct?



Thanks and best regards,

AEgir
 
A

AEgir Sveinsson

I have discovered the solution myself:

The magic lines are:
myCurrencyManager =
(CurrencyManager)this.BindingContext[dataSet1,"MyField"];

and

myCurrencyManager.EndCurrentEdit();



Thanks,

AEgir
 

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