Hi,
We have a grid with a Add new row" at the bottom.
When user exit from this row we want to display a warning (done with MessageBox), then we want to exit completly from edit mode end discard user changes.
We used "RowExitingEditMod" event.
We tried calling "ExitEditMode()" method from the grid, but unfortunately this fire again and again the same "RowExitingEditMod" event.
(see code below)
Do you have a solution for this ?
Thanks.
Alain.
Hello John,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Do you have a sample showing what you are doing? I don't know why an NRE would be raised or where it would be coming from from the snippet provided.
I am running into a similar issue. I don't really understand what is throwing the nullreference. Is there a check to ensure that this won't happen?
Something like
If grid1.IsEditing then
Grid1.ExitEditMode(false)
End if
Thanks,
John
Actually looking back over your code, why are you doing anything when the MessageBoxResult = OK?
A MessageBox will block the thread until a response is given.
Put a breakpoint on the "if". It shouldn't be hit until result is registered. So since they hit ok, let the method exit without cancelling it and let the edit happen.
Hi Darrell,
I already try that and get the following error when exiting "RowExitingEditMode" for the second time :
ExceptionObject = {System.NullReferenceException: object reference not set to an instance of an object. à Infragistics.Controls.Grids.XamGrid.ExitEditModeInternal(Boolean cancel) à Infragistics.Controls.Grids.XamGrid.ExitEditMode(Boolean cancel)
Regards.