try this :-
Make string of data from rowlist and add into your delete query
string data= null;
if (dataGridView1.SelectedRows.Count > 1)
{
List<string> rowList = new List<string>();
foreach (DataGridViewRow r in dataGridView1.SelectedRows)
{
if (r.Cells[3].Value.ToString() != null)
{
rowList.Add(r.Cells[3].Value.ToString());
data = data + "'" + r.Cells[3].Value.ToString() + "',";
}
}
}
if (Strings.Len(data) >= 1) {
data = Strings.Mid(data, 1, Strings.Len(data) - 1);
}
commandtext = "delete mytable where recordid in(" + data + ")";