Hi Team,
This is regarding UltraCombo Control (Under Namespace - Infragistics.Win.UltraWinGrid, version 13.1)
Scenario :
The ultracombo control is subscribed to dynamic data updates on the fly.
consider the control is initialized with 1500 count on the screen, after sometime say service send some updates with 700 count. The Subscribed event say ListChange() is called where the control's datasource is assigned again.
say,
ultracombo1.DataSource = NewUpdateDataList;
Now if user try to type and search for some records at some cases it throws exception.
Below exception is given :
Requesting the team to shed some light why its working in a weird way.
Please help me understanding what are the possible causes for this issue.
Thanks,
Pratik
Hi Pratik,
What exactly do you mean by "The ultracombo control is subscribed to dynamic data updates on the fly." The UltraCombo has a DataSource and it listens to notifications from the IBindingList interface. That's the only subscription to notifications that I am aware of.
From your description, this has strong connotations of a threading issue. You mentioned a service and that you are rebinding the UltraCombo to a new data source. My guess is that your service is running on another thread and you are crossing threads here without proper marshaling.
Hi Mike,
Thanks for the reply. Yeah you are right i have service which returns a list<ClassA> back.
Just to elaborate more over dynamic updates below is the piece of code
static void ServiceData_ListChanged(object sender, ListChangedEventArgs e) { if (e.ListChangedType == ListChangedType.ItemAdded) { SetRefreshButtonToolTip("Please click 'Update' to refresh the list"); _workItem.CommandManager.RefreshFilterCommand.CanExecute = true; //enables a refresh button when user clicks on it the list updates. this is the recent update we did to avoid the error } }
//Responsible to update the control public void RefreshButton_Click() { _viewModel.OriginalDataList = _Service.GetReferenceData<ClassA>().ToList(); // gets the latest feeds and assign to the view model object ultraCombo1.DataSource = _viewModel.OriginalDataList; // assigning back to control SetRefreshButtonToolTip("Data is up to date"); }
Can you please help me understanding whats going wrong here so i can try to correct and overcome. Else please suggest some solution or pointers to it. If threading is the only issue you see here ill make sure then im on UI thread when it re-assign data back to control.Thanks,