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
150
Object reference exceptions thrown in XamDataGrid when selecting a value in a ComboBox
posted

Running 17.2.20172.1000 libraries.

I recently ran into an issue where:

1) I have a two-column label/value XamDataGrid with a value cell using a template containing a XamComboEditor.

2) The XamDataGrid is in a pane too short to display the entire grid (vertical scrollbar is visible).

3) I change the value in the XamComboEditor, which changes the template in the row beneath it.

4) I get a series of repeated object reference exceptions in MessageBoxes, and the program crashes.

The exception, inner exception and top part of the call stack:

Message: Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Infragistics.Windows.DataPresenter.DataPresenterBase.GetRecordPresentersInViewHelper(FrameworkElement parent, Panel topLevelPanel, List`1 recordPresenters, Boolean recursive, Boolean onlyFullyInViewInXDimension, Boolean onlyFullyInViewInYDimension, Boolean excludeFixedRootRecords, Type restrictToRecordType, Boolean ignoreAnimations, Boolean dontExcludeActiveRecord)
   at Infragistics.Windows.DataPresenter.DataPresenterBase.GetRecordPresentersInView(Boolean recursive, Boolean ignoreAnimations, Boolean skipUpdateLayout, Boolean processPendingInvalidateGeneratedStyles)
   at Infragistics.Windows.Automation.Peers.DataPresenter.DataPresenterBaseAutomationPeer.GetRecordsInView()
   at Infragistics.Windows.Automation.Peers.DataPresenter.DataPresenterBaseAutomationPeer.<GetRecordsInView>d__28.MoveNext()
   at Infragistics.Windows.Automation.Peers.DataPresenter.ViewableRecordCollectionAutomationPeer.GetChildrenHelper(Boolean forceGetAll)
   at Infragistics.Windows.Automation.Peers.DataPresenter.ViewableRecordCollectionAutomationPeer.GetChildrenCore()
   at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   at System.Windows.Automation.Peers.AutomationPeer.GetChildren()
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
....

and

InnerException: 'System.NullReferenceException: Object reference not set to an instance of an object.
   at Infragistics.Windows.DataPresenter.DataPresenterBase.GetRecordPresentersInViewHelper(FrameworkElement parent, Panel topLevelPanel, List`1 recordPresenters, Boolean recursive, Boolean onlyFullyInViewInXDimension, Boolean onlyFullyInViewInYDimension, Boolean excludeFixedRootRecords, Type restrictToRecordType, Boolean ignoreAnimations, Boolean dontExcludeActiveRecord)
   at Infragistics.Windows.DataPresenter.DataPresenterBase.GetRecordPresentersInView(Boolean recursive, Boolean ignoreAnimations, Boolean skipUpdateLayout, Boolean processPendingInvalidateGeneratedStyles)
   at Infragistics.Windows.Automation.Peers.DataPresenter.DataPresenterBaseAutomationPeer.GetRecordsInView()
   at Infragistics.Windows.Automation.Peers.DataPresenter.DataPresenterBaseAutomationPeer.<GetRecordsInView>d__28.MoveNext()
   at Infragistics.Windows.Automation.Peers.DataPresenter.ViewableRecordCollectionAutomationPeer.GetChildrenHelper(Boolean forceGetAll)
   at Infragistics.Windows.Automation.Peers.DataPresenter.ViewableRecordCollectionAutomationPeer.GetChildrenCore()
   at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   at System.Windows.Automation.Peers.AutomationPeer.GetChildren()
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
....

If the window is tall enough to display the entire grid, I do not get the exception.  Furthermore, only a handful of devs at the company can replicate the issue at all.  (I can on a physical Win7 and a Win10 VM.)

I installed previous versions of our software and discovered that the issue was only present in versions that used 17.2 libraries.  (No bug found in 16.2)

In the XamDataGrid declaration, we set RecordContainerGenerationMode="LazyLoad".  As a temporary fix, if I change that to RecordContainerGenerationMode="Recycle", I do not see the exceptions, and all is good with the world, so we have a workaround.

Based on the release notes for 18.2, this seems like something has been reported elsewhere and has been addressed.  Can you confirm this?  (I can add additional info if necessary.)

We will be updating to 18.2 in the coming months.

  • 29910
    Offline posted

    Hello Gordon,

    I have been investigating into the behavior you are seeing and looking through our internal tracking systems as well as the methods that are within the stack traces that you have provided, I am not seeing a logged issue matching this, and the most recent method change appears to have been in 2015, which was well before 17.2 was released.

    With that said, it is certainly possible that this was fixed as a result of a different fix, but for me to know that for sure, I would need to be able to reproduce the issue locally. There are a bunch of different factors in this case, as there are multiple ways to place a XamComboEditor in the XamDataGrid, there are multiple XamComboEditor elements in the Infragistics for WPF toolset, and your pane setup could have a potential effect in this case as well.

    For now, though, as you are currently built against the base version of 17.2 (17.2.20172.1000) and since 17.2 has since had its final service release, I would recommend upgrading to the newest version of 17.2 and testing there to see if the issue still exists. If it doesn’t it very likely does not exist in version 2018.2. In order to upgrade to the latest service release, I would recommend following these steps:

    1. View My Keys and Downloads: https://www.infragistics.com/my-account/keys-and-downloads
    2. Log in to the Infragistics web site if you are not already logged in.
    3. Select the product you would like to download a service release for.
    4. Select the “Service Releases” tab.
    5. Select the download (e.g. Infragistics WPF 2017.2 - Service Release)

    The latest service release for version 2017.2 is 17.2.20172.2217.

    Please let me know if you have any other questions or concerns on this matter.