Record level validation

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

I want to perform some record-level validation, to be applied when the user
tries to move from the record (to another record, or close the form). Where
can I do this ?

I have tried putting it in the PositionChanged event of my binding manager
but this fires for the record moved TO not the one moved FROM. I want to be
able to prevent navigation away from the record until validation is passed
 
Hi JezB:

You can do it with visual tools by trapping the changed event of whatever
control you want and use the BindingContext's position b/c it will
correspond to the underlying datatable.

However this is a lame approach. Trap the RowChanged and or RowChanging
event b/c you don't need to revalidate if nothing changed, only if the rows
actually change....
 
Back
Top