Datagrid Column Validation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
How can i validate user input in a datagrid ?
I want a column to accept just numeric values. If the user enter Text then
the changes must be rejected and the value set to waht it was earlier.
Thanks in advance
-ZS
 
ZS said:
Hi,
How can i validate user input in a datagrid ?
I want a column to accept just numeric values. If the user enter Text then
the changes must be rejected and the value set to waht it was earlier.
Thanks in advance
-ZS

You will have to override the DataGridTextBoxColumn and handle it in the
keypress event. There may be a way to drill down and handle the event
without having to create your own class, but I can't think of where to
do that off the top of my head.

Chris
 
ZS said:
Hi,
How can i validate user input in a datagrid ?
I want a column to accept just numeric values. If the user enter Text then
the changes must be rejected and the value set to waht it was earlier.
Thanks in advance
-ZS
 
Hi Chris,
Thanks for your reply. The DataColumn constructor has a way to specify
the type of the data that it can accpet so we jusy specify it there instead
of a Keypress event.
-ZS
 
Back
Top