【发布时间】:2011-10-31 14:52:16
【问题描述】:
我有gridview,它的数据源是list<string>,我添加了一个复选框列来选择我想要删除的行,然后按删除。
attachdatagrid.DataSource = ConceptProperties.conceptsattachmentsfilename[mouseOverIndex].Select(x => new { FileName = x }).ToList();
问题是我的
gridview 编辑模式
properties是EditOnKeystroke,和我写的时候
if ((bool)dr.Cells[0].Value != false)
{
found = true;
ConceptProperties.conceptsattachments[mouseeditIndex].RemoveAt(dr.Index);
ConceptProperties.conceptsattachmentsfilename[mouseeditIndex].RemoveAt(dr.Index);
attachdatagrid.Rows.RemoveAt(dr.Index);
}
我遇到了异常:
除非 DataGridView 是 数据绑定到支持更改通知的 IBindingList 和 允许删除。
如何删除该行?
【问题讨论】:
标签: c# winforms datagridview