المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Cancel CellValidating error in DataGridView, so can close form while invalid entry still present



C# Programming
01-15-2010, 03:50 AM
If the user has typed an invalid entry, so that CellValidating raises an error, and they then decide to abandon the edit and want to click the Cancel button, the form won't close because the eror still exists. Error needs to be cleared first.
I just can't work out a way to achieve that, short of teaching the user that if they click Cancel, and the form doesn't close, press Esc so text reverts to original and then click Cancel again. Not ideal. http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif