如何控制dataGridVeiw的删除操作 我想控制dataGridVeiw的删除操作,当符合某种条件时,则可删除,反之,则不删除 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 主要是添加控制逻辑到RowDeleting事件。 void CustomersGridView_RowDeleting(Object sender, GridViewDeleteEventArgs e) { // Cancel the delete operation if the user attempts to remove // the last record from the GridView control. if (CustomersGridView.Rows.Count <= 1) { e.Cancel = true; Message.Text = "You must keep at least one record."; } } 另外纠正一点,应该是GridView,不是DataGridView 分布式部署取数据的问题 存储过程报错 求用C#实现Myspl导入导出的代码…… 新人请教request.querystring相关问题 求余数出错问题 udpClient的send和receive是不是要使用线程? 关于无线网卡群发短信方面的知识,顶者有分!!!! ERROR [IM006] [Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr 失败 求助于高手:关于Console.Read()吃回车的问题 读入图象问题 一个用GDI+,DrawLines()函数的问题。请指教! C#中时间转换
void CustomersGridView_RowDeleting(Object sender, GridViewDeleteEventArgs e)
{
// Cancel the delete operation if the user attempts to remove
// the last record from the GridView control.
if (CustomersGridView.Rows.Count <= 1)
{
e.Cancel = true;
Message.Text = "You must keep at least one record.";
}
} 另外纠正一点,应该是GridView,不是DataGridView