Hi,
I'm trying to bind the DataSource of UltraWingrid to a custom dataset, which caused two NullReferenceExceptions being thrown in the Infragistics code. I'm haveing trouble to reproduce the exceptions as they are only thrown occationally.
Please kindly advise how this can be resolved.
Code:
private
{ //.....
productTypesFilterGrid.DataSource = productTypes;
Exception 1:
System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated(BindingManagerBase bindingManager) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated() at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember) at Infragistics.Win.UltraWinGrid.UltraGridBase.set_DataSource(Object value) at ......\src\Assemblies\AccountSearch.SmartParts\AccountSearchSettingsNew.cs:line 222
Exception 2:
System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinGrid.RowsCollection.InternalClearHelper() at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated(BindingManagerBase bindingManager) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated() at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember) at Infragistics.Win.UltraWinGrid.UltraGridBase.set_DataSource(Object value) at ......\src\Assemblies\AccountSearch.SmartParts\AccountSearchSettingsNew.cs:line 222
Thanks and Regards,
Tess
If the exceptions are only thrown occasionally, this sounds like an issue that might be caused by the use of threading; you need to make absolutely certainly that any actions that may affect the UI (which includes binding the grid or modifying the data source that the grid, or any UI component is bound to), is modified on the main UI thread.
-Matt
Hi Matt,
Thanks for your reply. The thread is actually switched back to the main UI thread before InitializeSettings is called.
void
IAccountSearchSettings.InitializeSearchSettings(ProductFamilyFilterDataSet productTypes)
{
if (InvokeRequired)
BeginInvoke(
new InitializeSettingsCallback(InitializeSettings), new object[] { productTypes });
}
else
InitializeSettings(productTypes);
Can it be the problem of the custom dataset?
Thanks,