|
 |
ado_dotnet thread: bound controls not updating dataset
Message #1 by "Tony Frankland" <tfrankland@y...> on Tue, 4 Feb 2003 14:32:31
|
|
I have found that if the value of a bound control is changed
programmatically then the underlying datatable-column that the control is
bound to does NOT get updated.
It only gets updated if the control's bound property is changed by using
the control itself.
Is there a way around this, is this a known issue.
Message #2 by "Brian Smith" <bsmith@l...> on Tue, 4 Feb 2003 15:46:30 -0000
|
|
Have you called EndCurrentEdit()? Generally speaking, it's probably
better to update the DataSource and let the binding reflect the change
to the control, but I guess it should work the other way around, but you
may need to inform the CurrencyManager that a change has occuured.
brian
-----Original Message-----
From: Tony Frankland [mailto:tfrankland@y...]
Sent: Tue, 04 Feb 2003 14:33
To: ADO.NET
Subject: [ado_dotnet] bound controls not updating dataset
I have found that if the value of a bound control is changed
programmatically then the underlying datatable-column that the control
is
bound to does NOT get updated.
It only gets updated if the control's bound property is changed by using
the control itself.
Is there a way around this, is this a known issue.
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
Message #3 by "Tony Frankland" <tfrankland@y...> on Tue, 4 Feb 2003 19:13:41
|
|
Thanks brian,
I have used EndCurrentEdit in certain other places in my code and it
definitely solves a few update issues :) but this case is slightly odd
because it seems as if the current record is never actually being edited.
When I use the CurrencyManager it updates/keeps the record with the same
original value because it hasn't been modified in any way - the bound
control never seems to tell the underlying datatable that anything has
happened.
When the user checks/unchecks a checkbox I need to set a bunch of controls
to different values - and I would rather set the controls than edit each
of their specific columns in the datatable.
tony.
> Have you called EndCurrentEdit()? Generally speaking, it's probably
better to update the DataSource and let the binding reflect the change
to the control, but I guess it should work the other way around, but you
may need to inform the CurrencyManager that a change has occuured.
brian
|
|
 |