Hello
I'am trying to work with databinding.
To create the datasource I just fill a Dataset with one table (ex. Config)
the config table contains only 1 row.
The Config form containg checkboxes, and i run though the controls to set
the binding
Binding objBind = new Binding("Checked", _Datasource.Tables[0],
"CustomerNumberLocked");
chk001.DataBindings.Add(objBind);
chk001.DataBindings[0].DataSourceUpdateMode =
DataSourceUpdateMode.OnPropertyChanged;
If I click the chk001 to change the Checked value, the current row within
the _Datasource.Tables[0] does get updated - Ill tests this by saving the
_Datasource to a XML file.
To save the changes to database, i've created a method that checks for
changes within the dataset (_Datasource)
DataSet changes = _Datasource.GetChanges();
If ( changes != null )
{
...... It never comes to here, where the actually saving code exists.
}
The reason that it never comes to the saving codes, is because the RowState
never changes.
And why is that?
Kind regards
Johnny E. Jensen
Johnny E. Jensen - 01 Apr 2007 17:14 GMT
Hello
I should have read some more about this isue. When I wraped the datasource
into a CurrencyManager, and just before the acutal saving the datasource, i
use the .EndCurrentEdit(); And now the RowState changes to Modified.
Kind regards
Johnny E. Jensen
> Hello
>
[quoted text clipped - 29 lines]
> Kind regards
> Johnny E. Jensen