ErrorProvider & Winforms

Posts   
 
    
Srikar
User
Posts: 4
Joined: 12-Feb-2009
# Posted on: 12-Feb-2009 19:53:06   

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);
     }
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Feb-2009 03:24:23   

Hi Srikar,

Those validation icons are shown when the field value is invalid. So you must implement Field Validation. I recommend you to see the Validation Example at examples page (both for ASP.Net and Winforms).

David Elizondo | LLBLGen Support Team