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();

            }

你可能感兴趣的:(2010)