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
95
Exception: Operation can not be performed when not in edit mode
posted

Hi,

Here is another strange exception that was reported to me by a customer using the software I developed using the Infragistics WPF controls in version 16.1.20161.1000. I have no information what the user was doing, and I cannot reproduce the exception. I only know it occurred when entering data into a WPF data grid.

Without being able to reproduce the problem I have little hope to find a solution, but maybe someone has had the same problem before and has any idea on what might have gone wrong.

Thanks,
Hannes

2017-07-06 13:27:40.000    System.InvalidOperationException    Operation can not be performed when not in edit mode.       
bei Infragistics.Windows.Editors.XamMaskedEditor.EnsureInEditMode()
   bei Infragistics.Windows.Editors.XamMaskedEditor.SelectAll()
   bei Infragistics.Windows.DataPresenter.CellValuePresenter.OnEditModeStarted(EditModeStartedEventArgs e)
   bei Infragistics.Windows.Editors.ValuePresenter.ClassHandler_EditModeStarted(Object sender, EditModeStartedEventArgs e)

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello hannes565,

    I can confirm that this exception is intentionally thrown on our end, but the reason that it is actually managing to get into the code-path that throws it is unknown to me. The "EnsureInEditMode" method mentioned in the stack trace is called just as the XamMaskedEditor goes into edit mode as well as when the SelectAll method of the editor is called and when a clipboard operation tries to happen. From the stack trace you have provided, it appears that this is happening just as you are starting edit mode, but it is failing this pass internally:

    internal void EnsureInEditMode( )
    {
       // Throw an exception if not in edit mode.
      //
        if ( !this.IsInEditMode )
     throw new InvalidOperationException( XamMaskedEditor.GetString( "LE_InvalidOperationException_10" ) );
    }

    It almost sounds as if your users that are reproducing this are hitting a timing issue between when the editor's IsInEditMode property is updated and when this method is called, although I cannot be sure on this matter. Unfortunately, I do not see any records of this exception happening for others, and as such, I would require a sample project or some steps to reproduce this behavior that you are seeing. Perhaps it would be possible for you to contact the user that is reproducing this issue and find out exactly what is happening on their end that is producing this exception?

    You have also conveyed that you are using the base-version of our 2016.1 WPF product (16.1.20161.1000). It may be possible that this issue was fixed in a later version, but in order to receive that fix, you would need to update to the latest version of the 2016.1 product. Again, I am unsure though, as I am unable to find any records of this exception happening elsewhere. You can update to the latest version by downloading the Service Release after signing into your account on the Infragistics website at https://es.infragistics.com/my-account/keys-and-downloads.

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

    Sincerely,
    Andrew
    Associate Developer

Children