开发者

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";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜