乘以datagridview中的两列 [英] multiply the two columns in datagridview
本文介绍了乘以datagridview中的两列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
int s1 = Convert.ToInt16(dataGridView1.CurrentRow.Cells[3].Value);
int s2 = Convert.ToInt16(dataGridView1.CurrentRow.Cells[6].Value);
int s3 = s1 * s2;
dataGridView1.CurrentRow.Cells[38].Value = s3;
这个工作正常
当我在dataGridView1.CurrentRow.Cells [3]中更改值时,它会与更改后的值相乘
with dataGridView1.CurrentRow.Cells [6]并显示值
dataGridView1.CurrentRow.Cells [38]
喜欢
cell [3] cell [6] cell [38]
5 5 30
请帮助
提前谢谢
this is working fine
when i change the value lively in dataGridView1.CurrentRow.Cells[3] it multiply with the changed value
with dataGridView1.CurrentRow.Cells[6] and display the value in
dataGridView1.CurrentRow.Cells[38]
like
cell[3] cell[6] cell[38]
5 5 30
pls help
thanks in advance
推荐答案
使用 DataGridView。 CellValueChanged [ ^ ]事件。在文章的最后,您将找到一个示例代码。
Use DataGridView.CellValueChanged[^] event. At the end of article you'll find an example code.
这篇关于乘以datagridview中的两列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文