Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / April 2007

Tip: Looking for answers? Try searching our database.

Databinding to update RowState

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johnny E. Jensen - 01 Apr 2007 11:22 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.