0
Есть ли другой способ удалить столбец gridview, за исключением использования индекса .. Я использую gridview с несколькими флажками. Я хочу, чтобы удалить весь этот столбец, флажки проверяются .. Я retriving флажков, как ..gridview column delete
protected void ButtonApprove_Click(object sender, EventArgs e)
{
StringCollection sc = new StringCollection();
string id = string.Empty;
for (int i = 0; i < GridView1.Rows.Count; i++)//loop the GridView Rows
{
//find the CheckBox
CheckBox cb =
(CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox1");
if (cb != null)
{
if (cb.Checked)
{
// get the id of the field to be deleted
id = GridView1.Rows[i].Cells[1].Text;
// add the id to be deleted in the StringCollection
sc.Add(id);
}
}
}
UpdateRecords(sc);
}
Более подробную информацию, пожалуйста, что вы делаете и что вам нужно – Dotnet
Итак, вы хотите удалить все выбранные записи справа – Dotnet
. Я хочу удалить все отмеченные и добавить их в другое gridview – user123