UPDATE: The Program Manager at Microsoft in charge of this area of the .NET Framework has confirmed that this was a bug, and that it will be fixed in the next update.
We've noticed some breaking changes in the System.Data assembly,
version 2.0.50727.1378, changes that will affect the way the XtraGrid
works when adding new records. This is the version that gets installed
with Visual Studio 2008 beta 2.
Suppose we have the following code (where the event handlers also log
their execution):
CurrencyManager manager = GetCurrencyManager(CreateView());
manager.CurrentChanged += new EventHandler(manager_CurrentChanged);
manager.ListChanged += new System.ComponentModel.ListChangedEventHandler(manager_ListChanged);
manager.CurrentItemChanged += new EventHandler(manager_CurrentItemChanged);
manager.ItemChanged += new ItemChangedEventHandler(manager_ItemChanged);
WriteLog("===Add");
manager.AddNew();
WriteLog("===End");
manager.EndCurrentEdit();
With the old version of System.Data, we would get this output:
0: ===Add
1: ItemChanged e.Index:-1
2: ListChanged ItemAdded - old:-1, new:100
3: CurrentChanged
4: CurrentItemChanged
5: ===End
6: CurrentItemChanged
7: ItemChanged e.Index:-1
8: ListChanged ItemAdded - old:-1, new:100
With this latest version of System.Data, we get this instead:
0: ===Add
1: ItemChanged e.Index:-1
2: ListChanged ItemAdded - old:-1, new:100
3: CurrentChanged
4: CurrentItemChanged
5: ===End
As you can easliy see there are no longer any events fired with
EndCurrentEdit()
. This is hugely problematic since there
is no chance to find out when the adding of the current row has been
completed.
As it happens, we can handle the new behavior when all the data
operations are made through the grid and data controller (we are in
control, of course), but in many cases our customers will make direct
calls through the DataView
or through the
CurrencyManager
instance. In this latter scenario, the
DataController
and real DataView
will lose
synchronization and have different views of the universe, causing
unknown and unforeseen problems.
(Note that although I'm only talking about XtraGrid here, it's likely that this issue will affect other controls and applications as well, as well as other grid controls.)
We are in touch with Microsoft's CLR team to try and resolve this
issue.
Free DevExpress Products – Get Your Copy Today
The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the
DevExpress Support Center at your convenience. We’ll be happy to follow-up.