dataGridView选中单元格编辑,然后删除行时会报错,需要写如下语句
2011-09-02 10:26
351 查看
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
int x = dataGridView1.CurrentCellAddress.X;
int y = dataGridView1.CurrentCellAddress.Y;
if (dataGridView1[x, y].FormattedValue.ToString() == "") return;
}
{
int x = dataGridView1.CurrentCellAddress.X;
int y = dataGridView1.CurrentCellAddress.Y;
if (dataGridView1[x, y].FormattedValue.ToString() == "") return;
}
相关文章推荐
- 请教方法和例子:VS2003的datagrid控件,如何实现用鼠标拖动的方法选中任意区域的多个单元格,然后进行统一编辑??
- c#中选中dataGridView的一行或者多行,然后删除数据库对应的数据
- DATAGRIDVIEW动态筛选数据,实现编辑之后,点击按钮更新,及删除选中的列到数据库。
- [WinForm]DataGridView选中一行获取指定单元格的值
- Cxgrid获取选中行列,排序规则,当前正在编辑的单元格内的值
- GridView操作大全 无代码分页排序 正反双向排序 和下拉菜单DropDownList结合,选中,编辑,取消,删除
- c# 消除datagridview 单元格选中边框
- QT QTableWidget中实现整行选中和禁止编辑单元格
- DataGridView单元格退出编辑模式时发生
- DataGridView鼠标的拖放操作及单元格编辑结束数据复制与单元格单击数据粘贴及两个DataGridView相互拖放操作
- 用SQL语句创建和删除添加列和删除列编辑等
- DataGridView控件用法(二):为每行记录最后加“编辑”-“删除”按钮列
- GridView操作大全 无代码分页排序 正反双向排序 和下拉菜单DropDownList结合,选中,编辑,取消,删除
- [ORACLE]通用备份数据存储过程,适合编辑/删除前需要备份数据时使用
- 如何实现GridView的选中,编辑,取消,删除功能
- 让DataGridView中树节点指定的单元格不能编辑
- DataGridView的选中编辑
- QT QTableWidget中实现整行选中和禁止编辑单元格
- [VB.NET]怎样才可以右击选中datagridview控件中的单元格(1000分问题)
- DataGridView 单元格编辑后焦点移动到该行的另外一列而不换行