当前位置:编程学习 > C#/ASP.NET >>

datagridview单元格编辑后调用事件

        void DataGridView1CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
         float Sale=float.Parse(dataGridView1[4,e.RowIndex].Value.ToString());
         int SaleCount=(int)float.Parse(dataGridView1[3,e.RowIndex].Value.ToString());
         float Price=float.Parse(dataGridView1[3,e.RowIndex].Value.ToString());
         int StockCount=(int)float.Parse(dataGridView1[5,e.RowIndex].Value.ToString());
         StockCount=StockCount-SaleCount;
         Sale=Price*SaleCount;
        }
 这个代码没起作用
不知道是位置不对还是代码本身的问题
这里的图片本地的怎么上传啊
谁帮忙解决下这个代码的问题
最好能加我q583395072 --------------------编程问答-------------------- DataGridView1_CellEndEdit中
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
sda.Update(ds);
this.dataGridView1.DataSource = ds.Tables[0];
--------------------编程问答-------------------- 我用的是sqlhelper
用存储过程进行更新
所以.Update()的方法不行 --------------------编程问答-------------------- sqlhelper只是封装了update嘛,对应改一下就好啊 --------------------编程问答-------------------- 关注~~~~~~
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,