foreach (DataGridViewRow Row in resultadosdelaconsulta.Rows) { String strFila = Row.Index.ToString(); foreach(DataGridViewCell cell in Row.Cells) { string Valor = Convert.ToString(cell.Value); if (Valor == this.BuscarEnDGB.Text) { resultadosdelaconsulta.Rows[Convert.ToInt32(strFila) ].DefaultCellStyle.BackColor = Color.Red; } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter