Winform datagrid validation

  • Thread starter Thread starter sonu
  • Start date Start date
S

sonu

Hi

I have created a datagrid in a winform app. The data is
bound to sql datasource. A user can edit the values in the
datagrid.
How do i do validation of the data being entered by the
user on the submit button. The validations i want to check
are Integer, Date and Character.

Thanks
Sonu
 
Hi Sonu,

the easiest : Int the Submit button click eventhandler, before you acutally submit, you can do the checks.

Better: Controls have a validate event, that fires when the control looses focus.

Best: Create custom controls that are designed for specific data entry and prevent typos while typing.

HTH, Ulrich
 
Back
Top