I am using two forms,when I am sending the StockID from one
form to another form,in the second form there is some data in the gridview,now
I wan to do tat is,by using that id I want to highlight the that row only. I
want to compare the ID is exists in the gridview or not,if exits the I want to
Do the higlighten for that full row.,
if (pc == c)
{
for (int i = 0; i < grid_stock.Rows.Count; i++)
{
grid_stock.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.grid_stock.Rows[i].DefaultCellStyle.BackColor = Color.Red;
break;
}
}
Samuel Fernandes
10-Mar-2015Try this,
Give correct column index of StockID in row.Cells[0]