When a user adds a row to an unbound datagridview, then clicks out of
the row (or the control loses focus for any reason) without entering
anything, I would like to have the row automatically deleted. However,
I cannot find an appropriate event to handle this case. Using
CellEndEdit results in a re-entry, and CellValidating/Validated and
most other events result in an InvalidOperationException.
Does anyone know where I could put this logic?
Thanks.
simida - 31 Jul 2006 03:03 GMT
Maybe grid's Leave event will help you.
In this event handler function, you can get all grid items and check
the last item whether it is empty.
Hope it works.
Sincerely,
simida
Kelllisa@gmail.com 写道:
> When a user adds a row to an unbound datagridview, then clicks out of
> the row (or the control loses focus for any reason) without entering
[quoted text clipped - 6 lines]
>
> Thanks.
K - 31 Jul 2006 23:38 GMT
That might help; although I will need to handle the case where the user
clicks or arrows to another row in the grid, and not out of the control
entirely. I will give it a shot.
Thanks for your help
> Maybe grid's Leave event will help you.
>
[quoted text clipped - 18 lines]
> >
> > Thanks.