//-- function used to highlight a specific row public void FindDataRow(DataGridView myDataGrid, int iColIndex, string sColValue) { /* check to make sure we have a value */ if (myDataGrid != null && sColValue.Length > 0) { int iRow; /* loop through the collection and check the value */ for (iRow = 0; iRow < myDataGrid.RowCount; iRow++) { string myValue = myDataGrid[iColIndex, iRow].Value.ToString(); if (myValue == sColValue) { myDataGrid.Rows[iRow].Selected = true; myDataGrid.Rows[iRow].Cells[iColIndex].Selected = true; break; } } }