I have a gridview
and on RowDataBound
I use this code to change the background of every second row so the gridview
can be read better:
if (e.Row.RowIndex % 2 != 0)
{
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#f2f2f2");
}
After that I use a dropdown
to show only relevant rows of my gridview
and hide (visible = false)
the rows I didn't want to display. The rownumber doesn't change so the different background doesn't match for every second row now.
Now I'm looking to get the rownumbers of only the visible rows to change the color of every second row. Thanks