为什么不能删除DataTable中的当前行? 你首先要得到你选定的行DataRowView row = this.m_DataSet.Tables[0].DefaultView[this.dataGrid.CurrentRowIndex]; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 为什么用C#自己的工具生成的界面(自己未加一句代码),然后自己加一个按钮,写上:BindingSource.RemoveCurrent();却能正常删除选中的行? CurrencyManager gridCurrencyManager = (CurrencyManager)this.BindingContext[this.dataGridView1.DataSource, this.dataGridView1.DataMember];gridCurrencyManager.RemoveAt(this.dataGridView1.CurrentRow.Index); 发现了郁闷的问题: 在网格中双击以后,BindingSource.RemoveCurrent();OK。 单击不行,不知道什么原因。 自己解决了。原来网格的DataSource不能绑定到DataSet。虽然网格的DataSource和BindingSource的DataSoure是同一个DataSet,但是在绑定的时候,BindingSource的DataSource是DataSet,但网格的DataSource是BindingSource。这样用BindingSource.RemoveCurrent();就可以了。否则的话,网格要双击,BindingSource.RemoveCurrent();才有效。散分,虽然自己解决,但还是感谢热心人士。 怎样才能实现在C#里边运行vfp里的一段程序啊?请前辈指导!行感谢了! 如何找到在网上发信息的人?SQL如何防注入? 高分求助从ASP转到ASP.net如何解决网页排版的问题? sql 第一次写的C#代码 大家给点意见 C# Table不能自动增长,大侠们帮我看看吧,先谢了 请问如何对查询到的表进行二次查询? 查询文本框中值为空的数据怎么查 word中存在一个3行3列的表格,每个格子中有相应的内容,我想通过复制把此表格中的内容复制到某控件的相应表格中,应该如何操作? 地理信息系统 在对话框中改什么属性可以把那个"X"给去掉的? 如何访问文件夹中的所有文件列表内容?
BindingSource.RemoveCurrent();
却能正常删除选中的行?
(CurrencyManager)this.BindingContext[this.dataGridView1.DataSource, this.dataGridView1.DataMember];gridCurrencyManager.RemoveAt(this.dataGridView1.CurrentRow.Index);
在网格中双击以后,BindingSource.RemoveCurrent();OK。
单击不行,不知道什么原因。
原来网格的DataSource不能绑定到DataSet。虽然网格的DataSource和BindingSource的DataSoure是同一个DataSet,
但是在绑定的时候,BindingSource的DataSource是DataSet,但网格的DataSource是BindingSource。这样用BindingSource.RemoveCurrent();就可以了。
否则的话,网格要双击,BindingSource.RemoveCurrent();才有效。散分,虽然自己解决,但还是感谢热心人士。