datagridview中的textbox的leave事件 如题!我不知道这个事件生成,我现在想做的是有三个列:单价,数量,金额,这三个都是textbox,当我就改数量以后,金额自动计算,我知道用textbox的leave事件可以完成,但是在datagridview怎么生成? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用表格的dataGridView1_CellEndEdit可以实现 private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 数量.Index) { //在这里面计算 } } private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 数量.Index) { dataGridView1[金额.Index, e.RowIndex].Value = Convert.ToInt32(dataGridView1[数量.Index, e.RowIndex].Value) * Convert.ToDecimal(dataGridView1[单价.Index, e.RowIndex].Value); } } 解决了! 结贴给分 jishengzu 前台想得到C#中DropDownList3.Text的值?如何做? 关于webservice安全性的问题 用C#在WINCE下,鼠标按Button按钮,想实现按下时触发,抬起时触发怎么做? 请问如何在浏览器里显示word文档内容? ASP.NET程序放在WindowsXP上,其他机器无法访问,大家有没有办法? 谁有条形码的国家标准,这个网址无法下载了 求教:软件打开的速度慢 asp和.net中 session值可以互传吗? C#调用C++的COM,提示没有注册的错误 C#单词连连看 找不到标量变量@caid 为 sysIndex.aspx 执行子请求时出错。
{
if (e.ColumnIndex == 数量.Index)
{
//在这里面计算
}
}
{
if (e.ColumnIndex == 数量.Index)
{
dataGridView1[金额.Index, e.RowIndex].Value = Convert.ToInt32(dataGridView1[数量.Index, e.RowIndex].Value) *
Convert.ToDecimal(dataGridView1[单价.Index, e.RowIndex].Value);
} }
jishengzu