BindingManager Backward Navigation Fails (Visual Studio 7.1.3088, .NET Framework 1.1.4322)
I´ve got a strange problem: I´m using about a dozen controls of several types (grid control, text boxes, checked list boxes, list views, combo boxes) in a form with DataBinding. I´ve implemented data row navigation by modifying BindingManager.Position. All works well when moving forward by incrementing BindingManager.Position, but when it gets to backward navigation, this works only if I exclude some of my ComboBoxes from DataBinding. Otherwise, the first step back will set all controls to the first row.
Step-by-step example:
(1) In a data table with, say, 12 rows, I´m moving forward to row 6 by incrementing BindingManager.Position: all controls are correctly updated.
(2) Now I move backward three rows by decrementing BindingManager.Position: all controls are set to the first row after the first step backward.
(3) I move forward again: all controls stick to the first row, until I reach my first position, then updating continues in a correct way.
(4) Under these circumstances, always the highest row reached does count. If I repeat backwards movement at row 10, correct forward updating will continue only if the sum of decrements and increments has taken me to row 10 again.
So it looks like some internal counters are out of touch with each other.
To make it more strange: this behaviour occurs ONLY if I include SOME of my ComboBoxes into DataBinding. If I leave them out, backward navigation works fine. Unfortunately, I can´t see what distinguishes especially these ComboBoxes from the other ones I use. There´s no apparent different between them except the data column they map.
Could this be a bug of the .NET libraries? Has anyone experienced the same problems and found out a workaround?
Many thanks and best regards
Ingbert Jüdt
date: Fri, 10 Feb 2006 04:20:11 -0600
author: Ingbert Jüdt