How can i paint/highlight the line i m reading in gridview
I'm building a web site and i want to paint/highlight the line that i m reading. here is my code:
foreach (GridViewRow rw in gvHastalar.Rows)
{
rw.CssClass = "gvKontrolEdilenSatir";
}
Th开发者_Go百科anks in advance
If you have a particular row selected in the GridView you can compare the index of the current row in the foreach loop with the SelectedIndex
of the GridView. You can then conditionally set the CSS class if they match.
foreach (GridViewRow rw in gvHastalar.Rows)
{
if (rw.RowIndex == gvHastalar.SelectedIndex)
rw.CssClass = "SelectedCssClass";
else
rw.CssClass = "NotSelectedCssClass";
}
精彩评论