Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best practice on binding controls
Message
From
23/03/2005 10:19:40
 
General information
Forum:
ASP.NET
Category:
.NET Compact Framework
Miscellaneous
Thread ID:
00998417
Message ID:
00998421
Views:
47
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform