No, sorry it is not. I should have paid closer attention. See if the information at the bottom of this helps you:
http://msdn2.microsoft.com/en-us/library/ykdxa0bc.aspx>Is that code is working on DataGridView Control ? I've been tried to use that code in DataGridView but no luck ...
>
>Thanks :-)
>
>>Try something like (if you want to force numeric instead, change to ! to force numeric or use char.IsNumeric):
>>
>>public class NumbersOnlyTextBox : TextBox
>>{
>> public NumbersOnlyTextBox()
>> {
>> KeyPress += new KeyPressEventHandler( HandleKeyPress );
>> }
>>
>> private void HandleKeyPress( object sender, KeyPressEventArgs e )
>> {
>> if ( ( char.IsDigit( e.KeyChar ) || char.IsControl( e.KeyChar ) ) )
>> e.Handled = true;
>> }
>>}
>>
>>
>>>Hi all,
>>>
>>>I want to prevent non-numeric input from the first user's keystroke in DataGridView (mimic behaviour of Numeric TextBox in VFP).
>>>
>>>Anybody know how to do it ?
>>>
>>>Thanks in advance :-D
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"