Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best practice on binding controls
Message
De
23/03/2005 10:19:40
 
Information générale
Forum:
ASP.NET
Catégorie:
.NET Compact Framework
Divers
Thread ID:
00998417
Message ID:
00998421
Vues:
45
Franco,

Do you have any other bound controls besides TextBoxes? CheckBoxes maybe? ComboBoxes? Unless the compact framework is way different, TextBox binding should not be causing this to happen.

~~Bonnie



>Hi all,
>I'm creating a PocketPc application, and I'm studying how forms databind works.
>I have a very simple form which connect to a SQLCE db, exctract records from a table (select *), fill a dataset.datatable, and display data on texboxes.
>I have added buttons to scroll the table and I'm using a BindingManagerBase object to change the .position property.
>Everything works: clicking on buttons I can scroll records up and down.
>But I discovered that after I press one of the scroll button the dataset.haschanges always return .t. and the datarow.DataRowState is "modified" even if I don't change nothing in the textboxes!
>I:
>
>1) create the dataset
>2) add the datatable
>3) fill the datatable
>4) add something like Me.textbox.DataBindings.Add(New Binding("text", thedataset.Tables("thetable"), "field"))
>5) scroll records (i.e. Me.BindingContext(thedataset.Tables("thetable")).Position -= 1) clicking on buttons
>6) at this point dataset.haschanges = true
>
>If I don't change the textbox's values I expect that the dataset.haschanges return false, and the datarow.DataRowState is "Unchanged"
>What I'm missing here?
>
>Any help really appreciated
>
>Franco
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform