Windows应用程序中的datagridview的验证 [英] validation of datagridview in windows application

查看:64
本文介绍了Windows应用程序中的datagridview的验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据网格,我正在运行时输入值.我需要验证命名为数量的单元格,我只想输入数字.在哪种情况下,我必须为此编写代码?我正在使用带有C#的VS 2008 Windows应用程序.谁能帮我解决这个问题?

I have one datagrid and i am entering values in run time . i need to validate my cell named as quantity, in which i want to enter only numbers. in which event i have to write the coding for this? am using VS 2008 windows application with c#. Can anyone one help me to solve this?

推荐答案

简单的Google搜索就足以解决这个问题

在DataGridView中仅输入数字 [关于datagridview控件的事件 [ DataGridView KeyDown? [ ^ ]

祝您周末愉快
:java:
Simple Google search is enough for this

Enter Only Number In DataGridView[^]
About datagridview control''s event[^]
DataGridView KeyDown?[^]

Have a great weekend
:java:


因此您需要确定要使用的事件,可能是celledit或cellleave
创建一个使用事件的方法.
在需要标识要使用的单元格的方法中,检查事件参数(e)
确定所需的单元格后,执行所需的操作.

尝试检查正在使用的控件,了解主要事件和属性,这些将使您有效地操作控件.
So you need to identify the event you want to work with, probably celledit or cellleave
Create an method to consume the event.
In the method you need to identify the cell you want to work with, check out the event arguments (e)
Do what you need to do when you identify the cell needed.

Try inspecting the control you are working with, get to know the main events and properties, these wll allow you to manipulate the control effectively.


这篇关于Windows应用程序中的datagridview的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆