DataGridView 取得或者修改当前单元格的内容

DataGridView 取得或者修改当前单元格的内容
http://www.cnblogs.com/chaobaojun/archive/2010/05/13/1734461.html

datagridview 改变单元格内容就要触发一个事件
http://topic.csdn.net/u/20080909/13/a23b9769-702c-43dd-936c-949706b1d689.html?r=58893106

DataGridView指定单元格的编辑状态与修改
http://blog.csdn.net/biyusr/article/details/7324684

DataGridView.EndEdit方法结束编辑操作
本文来自: IT知道网(http://www.itwis.com) 详细出处参考:http://www.itwis.com/html/net/winform/20110926/11105.html

DataGridView相关知识(整理得好多,好常用)
http://blog.csdn.net/gkq8124372/article/details/6767596


DataGridView.NotifyCurrentCellDirty 方法 自定义

http://msdn.microsoft.com/zh-cn/library/system.windows.forms.datagridview.notifycurrentcelldirty(v=VS.85).aspx

CurrentCellDirtyStateChanged 在单元格的状态相对于其内容的更改而更改时发生。
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.datagridview_members(v=vs.85)


在单元格的状态相对于其内容的更改而更改时发生。
DataGridView.CurrentCellDirtyStateChanged
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.datagridview.currentcelldirtystatechanged(v=vs.85)

 


 if (e.ColumnIndex == 3)
            {
                if ( !String.IsNullOrEmpty(e.FormattedValue.ToString()))
                  {
                   decimal danjia = Convert.ToDecimal(e.FormattedValue.ToString());
                    int itemcount = Convert.ToInt32(dataGridView3.Rows[e.RowIndex].Cells[e.ColumnIndex - 1].Value);
                    decimal itemsum = danjia * itemcount;

                dataGridView3.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = e.FormattedValue;
                dataGridView3.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value = itemsum.ToString();
                
                //this.Validate();
               // this.gradeBindingSource.EndEdit();

            }

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值