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
80
NullReferenceException thrown in PerformAction
posted

We are having trouble figuring out how we can wrap the following code to avoid the NullReferenceException being thrown:

 

m_propertyTree.PerformAction(

UltraTreeAction.ExitEditModeOnCellSaveChanges, false, false);

Stack trace shows the following:

  Infragistics2.Win.UltraWinTree.v8.2.dll!Infragistics.Win.UltraWinTree.CellNavigator.IsFirstCellInNodeActive.get() + 0x3b bytes 
  Infragistics2.Win.UltraWinTree.v8.2.dll!Infragistics.Win.UltraWinTree.UltraTree.CurrentState.get() + 0x2a6 bytes 
  Infragistics2.Win.UltraWinTree.v8.2.dll!Infragistics.Win.UltraWinTree.UltraTree.PerformAction(Infragistics.Win.UltraWinTree.UltraTreeAction actionCode = ExitEditModeOnCellSaveChanges, bool shift, bool control) + 0x46 bytes
 

When I check the CurrentState, it's null before the PerformAction is called. Is this the problem or is it something else in the IsFirstCellInNodeActive?

  • 69832
    Suggested Answer
    Offline posted

    yj8311 said:
    When I check the CurrentState, it's null before the PerformAction is called.

    What is null?

    This sounds like a bug because we should be preventing exceptions even if the action cannot be performed. My guess is that the control is not in the required state for the action to be performed, and one solution would be to get it in that state first so that the exception is not thrown and the action is successfully performed. If possible please provide a simple sample that demonstrates this and we can take a closer look.