You really don't want to validate with each KeyPress for several reason. For
example, the user might hit the wrong key by accidient, know it, and want to
backspace to correct it. In any case, this is not the model used by the
DataGridView. Use the DataGridView CellValidating event. There is an
excellent example of this on the MSDN2 Library:
http://msdn2.microsoft.com/en-us/library/ykdxa0bc.aspx
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
This is, by definition, not that.
"Greg" <gr*************@yahoo.co.uk> wrote in message
news:11**********************@38g2000cwa.googlegro ups.com...
I'm new to the datagridview control, and am left wondering how one goes
about restricting input to numeric only. Is it possible to trap key
presses at the cell level, and in the relevant columns, ignore them if
non-numeric?
Greg.