views:

437

answers:

1

hi in c# i can do the following...

 dataGridView1.Columns["Column2"].ValueType = typeof(double);

is it possible also to provide the range for those double values entered on that column rows... for example i want user to enter only values between 0.0-100.0...? thanks a lot!

+1  A: 

You can't do that by setting a property, but you can handle the CellValidating event and do the validation yourself.

You can then set the ErrorText property to an appropriate error message at the corresponding cell or row. You'll then have to set the ErrorText property to an empty string on the CellValidated event.

Meta-Knight