在DataGridView中更改CellValidating事件后如何获取单元格值 [英] How do I get cell value after change in CellValidating Event within DataGridView

查看:112
本文介绍了在DataGridView中更改CellValidating事件后如何获取单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在DataGridView中启用了CellValidating事件.当我输入一个值为A的单元格时,将其更改为B,然后退出该单元格,则触发该事件.但是,当我查看单元格中的数据时,在进行更改之前,我会得到值A.如果我移至另一个单元格,则返回第一个单元格,然后将B更改为C,然后再将其更改为C.时间,我得到的是我第一次更改为B的值.更改后如何获得该值以进行验证?

谢谢,Eddie

I have enabled a CellValidating event within a DataGridView. When I enter a cell that has a value of, say, A, make a change to B, and then exit the cell, the event fires. However, when I look at the data in the cell, I get the value before I made the change, A. If I move to another cell, then come back to the first cell and change the B to C, when I leave it this time, I get the value I changed to to the first time, B. How can I get the value after the change to validate?

Thanks, Eddie

推荐答案

使用 ^ ]


这篇关于在DataGridView中更改CellValidating事件后如何获取单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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