Guys,
I'm trying to change my Datagridview Row forecolor on the value of my Textbox if it matches
My code below doesn't seem to work, am I missing something else?
foreach (DataGridViewRow row in DataGridView1.Rows)
{
if (row.IsNewRow) break;
object obj = row.Cells[0].Value;
{
string content = obj.ToString();
if (content == param1ToolStripTextBox.Text)
{
row.DefaultCellStyle.ForeColor = Color.Red;
}
}
}

VulpesRank #55 · 29.2K reputationPosted Jul 21, 2014, 7:45 AM EDT
To allow for that, you can do:
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 21, 2014, 7:36 AM EDT
Try to add a line after this row.DefaultCellStyle.ForeColor = Color.Red;
Accept the changes to grid
mike DelvottiRank #7,298 · 244 reputationPosted Jul 21, 2014, 8:06 AM EDT
Thank you Ramesh for the reply
Vulpes, your code snippet there did the trick, Thank you