I have one datatable which has
DataTable:
SeqNo ItemID ItemName
------- ------ --------
1 10 AAA
2 20 BBB
3 30 CCC
Now I want to remove the Row which has the SeqNo "3".
Now I am doing like this in GridView RowCommand Event:
if (e.CommandName == "Delete")
{
string SeqNo = e.CommandArgument.ToString();
for (int i = 0; i < DTItem.Rows.Count; i++)
{
if (SeqNo == DTItem.Rows[i]["SeqNo"].ToString())
{
DTItem.Rows.Remove(DTItem.Rows[i]);
}
}
}
But without loops, How to remove the row based on this condition?