グリッドテーブルには、データベースによって埋められた5つの行があります。
どこかを削除したい場合。
解決:
datatableTempを作成し、gridViewで削除した後、テーブルTempも削除します。
その後、tableTempでGridViewを埋めます。
//========Get datatable from database.
dtTempGrdBlockForDeviceByRole = Cls_BLOCKS.getDataTable_WriteField();
grdBlockForDeviceByRole = Cls_BLOCKS.getDataTable_WriteField();
for (int x = 0; x < grdBlockForDeviceByRole.Rows.Count; x++)
{
CheckBox chk = grdBlockForDeviceByRole.Rows[x].FindControl("ckDelete") as CheckBox;
string txtD = grdBlockForDeviceByRole.Rows[x].Cells[0].Text;
if (chk.Checked)
{
//If choice
//What should we do in here?
}
}
grdBlockForDeviceByRole.DataSource = dtTempGrdBlockForDeviceByRole;
grdBlockForDeviceByRole.DataBind();
あなたは私を助けることができます?