Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
UltraComboEditor DataBinding Problem
posted

I have a few UltraComboEditor using complex databinding on a form, and the DataSource of these editors changes based on some other entries on the form. The Value property (for SelectedItem) in these editors are also data-bound through simple databinding.

 The problem is that whenever the underlying DataSource changes for these UltraComboEditor, I receive "This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row." exception. The stack trace is below:

   at System.Data.DataRow.GetDefaultRecord()
   at System.Data.DataRow.GetRecordFromVersion(DataRowVersion version)
   at System.Data.DataRow.get_Item(DataColumn column, DataRowVersion version)
   at System.Data.DataRowView.GetColumnValue(DataColumn column)
   at System.Data.DataColumnPropertyDescriptor.GetValue(Object component)
   at Infragistics.Win.BindableValueList.GetBoundValueHelper(ValueListItem item, String propertyName)
   at Infragistics.Win.BindableValueList.GetBoundDataValue(ValueListItem item)
   at Infragistics.Win.ValueListItem.get_DataValue()
   at Infragistics.Win.UltraWinEditors.UltraComboEditor.HasSelectedItemDataValueChanged(Int32 lastSelectedIndex)
   at Infragistics.Win.UltraWinEditors.UltraComboEditor.OnValueChanged(EventArgs args)
   at Infragistics.Win.UltraWinEditors.TextEditorControlBase.OnValueChanged(Object sender, EventArgs args)
   at Infragistics.Win.EmbeddableEditorBase.RaiseValueChangedEvent()
   at Infragistics.Win.EditorWithCombo.Infragistics.Win.IValueListOwner.OnSelectedItemChanged()
   at Infragistics.Win.ValueList.ProcessSelectedIndexChanged(Int32 selectedIndex, Boolean commit)
   at Infragistics.Win.ValueList.set_SelectedIndex(Int32 value)
   at Infragistics.Win.BindableValueList.Bind()
   at Infragistics.Win.BindableValueList.RefreshDataItems()
   at Infragistics.Win.UltraWinEditors.UltraComboEditor.DataBind()

It seems to me that when the underlying DataSource is refreshed, the UltraComboEditor raises SelectedItemChanged event, but as it cannot find the original ValueListItem, it generates the exception.

My question: is it possible to prevent SelectedItemChanged event from firing when the DataSource is being refreshed? Is there a recommended procedure on refreshing the DataSource for UltraComboEditor? 

I am using v2007.1.

Thanks.

Parents
No Data
Reply Children