Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1834
How to validate cell when saving changes from Toolbar button (and focus not lost from cell)?
posted
Hi,

I've got an UltraGrid that allows users to edit a Name field. To require a name, I have the Nullable setting for that column to Disallowed. This works fine normally, but the Save button is in a toolbar ribbon, so it doesn't actually pull focus away from the cell when clicked (thus allowing an empty string in the column that throws an error on UpdateData()).

I've tried doing a PerformAction(ExitEditMode) at the start of the Save code, and it correctly fires the validation, but then proceeds with the rest of the Save code.

Is there an easy way for me to validate, cancel the Save, and retain focus on the bad cell?

Thanks,
J