简体   繁体   English

DataGridView单元格值更改

[英]DataGridView Cell Value Changing

Is there any way to get the datagridview cell value when changing? 更改时是否有任何方法可以获取datagridview单元格值?

I have a datagridview with 5 columns such as Invoice number, Invoice Date, Invoice For, Qty, Rate, Unit Price. 我有一个5列的datagridview,例如发票编号,发票日期,发票,数量,费率,单价。

When i changing the qty or rate, application needs to multiplies the qty and rate and put it them into Unit Price cell. 当我更改数量或比率时,应用程序需要将数量和比率相乘并将其放入“单价”单元格中。

I have already tried with CellValueChanged with CurrentCellDirtyStateChanged. 我已经尝试过将CurrentValueDirtyStateChanged与CellValueChanged一起使用。 But it end edit the cell value of my current editing cell's data. 但是它结束了编辑当前编辑单元格数据的单元格值。 which cause that unable to enter further data into that cell. 这导致无法将更多数据输入该单元格。

Cell Value Changing Event ,c# 单元格值更改事件,c#

Please help me to solve this. 请帮我解决这个问题。

您可以尝试将单元格验证事件与单元格值更改事件一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM