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
265
NullReferenceException when binding DataSource
posted

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

 

void InitializeSettings(ProductFamilyFilterDataSet productTypes)

{       //..... 

        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

 

Parents
  • 37774
    Suggested Answer
    posted

    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

Reply Children