I\'m using a ListView in C# to make a grid. I would like to find out a way to be able to highlight a specific cell, programatically. I only need to highlight one cell.
In my case, I wanted to highlight specific rows, including all the fields. So every row in my listview with "Medicare" in the first column gets the entire row highlighted:
public void HighLightListViewRows(ListView xLst)
{
for (int i = 0; i < xLst.Items.Count; i++)
{
if (xLst.Items[i].SubItems[0].Text.ToString() == "Medicare")
{
for (int x = 0; x < xLst.Items[i].SubItems.Count; x++)
{
xLst.Items[i].SubItems[x].BackColor = Color.Yellow;
}
}
}
}