471,315 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,315 software developers and data experts.

Datagrid Column Validation

ZS
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

Dec 6 '05 #1
3 1844
ZS wrote:
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
Dec 6 '05 #2
ZS


"ZS" wrote:
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

Dec 6 '05 #3
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

"Chris" wrote:
ZS wrote:
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

Dec 6 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Lina | last post: by
5 posts views Thread by Chris | last post: by
5 posts views Thread by Tina | last post: by
reply views Thread by Jeremiah Adams | last post: by
1 post views Thread by Tom | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.