In my working project, I'm trying to replace the cells of Word table that have textual data by colored ovals into the C# code.
The Word table will be generated dynamically at the run time through my code.For example:
- replace the value for the cell that has the text A by Red Oval
- replace the value for the cell that has the text B by Green Oval
- replace the the value cell that has the text C by Yellow Oval.
Please if you could help me in that.
Saber ShaikhPosted Feb 3, 2015, 12:22 AM
{
for (int i = 0; i < dataGridView2.Rows.Count-1; i++)
{
if (dataGridView2.Rows[i].Cells[1].Value.ToString()=="A")
{
//Red use system.color
}
else if (dataGridView2.Rows[i].Cells[1].Value.ToString() == "B")
{
//Green use system.color
}
else if (dataGridView2.Rows[i].Cells[1].Value.ToString() == "C")
{
//Yellow use system.color
}
}
}
100% work