想进行多行删除,但是后台数据需要按保存按钮才调数据库sql 进行彻底删除,但是删除多行后 selectedRows 的数据也被清空了
请问怎么处理
RowCollection selectedRows=null;
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
{
LChimoku.BeginUpdate();
foreach (Row r in LChimoku.Rows.Selected)
LChimoku.Rows.Remove(r.Index);
LChimoku.EndUpdate();
}
private void SaveSToolStripButton_Click(object sender, EventArgs e)
{
Hashtable ht = new Hashtable();
selectedRows = LChimoku.Rows.Selected;
for (int r = 0; r < selectedRows.Count; r++)
{
String colNo = selectedRows[r]["ID"].ToString();
ht["ID"] = colNo;
Hashtable result = base.OperateDb("LChimoku", "DeleteLChimoku", null) as Hashtable;
}
}
|
|