Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
The problem generally occurs when there is an event handler on the combo's SelectedIndexChanged or SelectedValueChanged or other event that fires when the data source on the combo changes (or even if the combo is data-bound and the formatting can throw an exception). If an exception is thrown from within the handler, .NET snuffs the exception (it doesn't ever bubble up) and the ComboBoxItemCollection is never properly populated with the display and value member values. The value member is left as the raw collection object (the DataRowView), not the value of the property on the object. The display member is then set to the ToString() of the raw object, so the combo box is then populated with several "{System.Data.DataRowView}" entries. We added the code to attempt to circumvent the formatting errors that can occur when you set the data source.
|