I'm working on N-Tier Winform application using LLBLGen Pro V2.0 (Adapter). I wanted to provide a simple validation before the user hits the save button on the form. So when the user hits the save button, I wanted to show the Message box outling all the errors and also show the error provider icon next to all those controls which had the error.
I could get showing the Messaage box done but not the error provider icon.
***Could some one please help me on how to show those error provider icons next to the controls after hitting the save button?
So far...
I had created the validator class for the Entity and has overriden the method
void ValidateEntity(IEntityCore involvedEntity). In which I call the SetEntityFieldError() and
SetEntityError() methods for any of my validation errors and ultimately throw an ORMEntityValidationException.
In my WinForm the code look like this
try
{
toSaveEntity.ValidateEntity();
proxyService.SaveEntity(toSaveEntity);
}
catch (ORMEntityValidationException ex)
{
MessageBox.Show(ex.Message);
}