Hello,
We have the following code in our tableView_ValidateRow event handler method:
Codeprivate void tableView_ValidateRow(object sender, GridRowValidationEventArgs e)
{ bool isValid = false;
if (this.TypedViewModel.TryValidateEntity(e.Row as GeographicalArea, out isValid)) { e.Handled = true;
e.IsValid = isValid;
return;
}
else
{ e.Handled = true; }
}
In the TryValidateEntity we handle any exceptions that might get thrown and show them in a dialog box.
So, we do not let the exception bubble up to the tableView_ValidateRow event handler method.
When no exception gets thrown in the TypedViewModel.TryValidateEntity everything works fine.
But, when an exception does occure in the TypedViewModel.TryValidateEntity the tableView_ValidateRow gets called again??
Placing the if-else block in a try-catch-finally block does not solve this issue.
Why does the tableView_ValidateRow get called twice when an exception occurs and how can we prevent the mutliple calling of this method from happening?
PS. this same behavior with the TreeView_Selected event has been seen when using the TreeView
control in <dxn:NavBarGroup.Content> </dxn:NavBarGroup.Content>
Regards,
Arjan
Hi Arjan,
I cannot reproduce this behavior in a simple project (see the attachment). Am I missing anything?
Thanks,
Alex
Hello,
I have modified your sample project and managed to reproduce the behavior we see in our application.
Reproduction steps:
Click on the "Click here to add a new row"
Add some data
The next step is very important!
Use the keyboard arrow down to move to the next row
You get now a popup message box. Click on OK
To the question "Do you want to correct the values?" answer "YES".
Now the ValidateRow event gets fired a second time.
Strangely, in our application we do not see this question to correct the values…
and the ValidateRow event gets fired three times!?
Regards,
Arjan
Hello,
I've reproduced this issue and forwarded it to our R&D team for further research. Follow our notifications to be informed about our progress.
Thanks,
Kirill
The provided HotFix DevExpressComponents-15.2.4.16022 does indeed resolve this issue.
Thank you for providing the hotfix.
Hello,
Thank you for your clarification. If you experience any further difficulties, do not hesitate to contact us again.
Thanks,
Elliot