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
4341
Xamdatagrid EditMode Ending
posted

Hello Support, 

In our code we have a functionality on the EditMode Ending event of the Xamdatagrid. In this event we have few validations, only if the validation checks are satisfied the application will proceed to save the data into the database. In case the validation fails we do "e.cancel" and replace the previously set value to the cell. 

When we add an invalid entry in the cell/grid and then try to close the application the e.cancel method displays following error message. Can you please suggest a way to avoid this error.

A first chance exception of type 'System.NotSupportedException' occurred in InfragisticsWPF4.DataPresenter.v14.2.dll

Additional information: Can't cancel ending edit mode if it is forced

If there is a handler for this exception, the program may be safely continued.

  • 138253
    Verified Answer
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I can suggest you handle the Window’s Closing event, which will fire before the EditModeEnding and in there you can set a flag that the app will going to close. Then you can use that flag in the EditModeEnding event handler and doesn’t cancel the event. I created a sample project for you with this approach. Please let me know if this helps you or you have further questions on this matter.

     

    Looking forward for your reply.

    XamDataGridEditModeEndingCloseApp.zip