combo validation

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

hi all

when I add code to the validation method of a combobox, it get called
when I move to another field (just like it should) - but it doesn't get
fired if I click a button on a toolstrip.

is this by design, or is this an error?

what is an appropriate work around?

tia
 
hi all
when I add code to the validation method of a combobox, it get called
when I move to another field (just like it should) - but it doesn't
get fired if I click a button on a toolstrip.

is this by design, or is this an error?

what is an appropriate work around?

There are a number of cases when the validate isn't fired. You have identified
a couple of them. What I do is in my save button on a toolstrip, call .Validate
on the form in question. If I have items bound to a binding source, call
..EndEdit on the binding source. Additionally, you may need to call .EndEdit
on any DataGridViews to force the last update to be propigated correctly.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.asp
 
Back
Top