Find specific value in A DataGridView
Hi,
Well, I have a DataGridView binded to a TableAdapter and there is an extra empty column named "clmImg" to put an image or color in it.
I want to do the following :
search through the quantity column, if you find a value less than 15 then put a red color "or red image" in the empty column.
I don't know who to write the code. Any help??
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Aug 16, 2009, 4:23 AM EDT
that will result in what you want :)
foreach (DataGridViewRow r in dataGridView1.Rows)
{
if (Convert.ToInt32(r.Cells["quantity"].Value) < 15)
{
r.Cells["quantity"].Style.BackColor = Color.Red;
}
}
rania Magdy9 reputationPosted Aug 16, 2009, 4:49 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Aug 16, 2009, 5:52 AM EDT
by the way you can also call it will index
happy Coding :)
have n nice day :)