There are several way to do that
1-
designer page - itemstyle
you can make difference between even and odd rows if you want
<itemstyle cssclass="lnknew" />
<alternatingitemstyle cssclass="lnknew" />
2-
code behind - itemstyle usually in a init() method on pageload
grvShowhistory.HeaderStyle.CssClass = "lnknew";
grvShowhistory.RowStyle.CssClass = "lnknew";
3-
code behind - itemdatabound (make sure to have an itemdataboud method in the designer page
protected void dgv_ItemDataBound(object sender, DataGridItemEventArgs e)
{
switch (e.Item.ItemType)
{
case ListItemType.Item:
case ListItemType.AlternatingItem:
if(yourCondition)
{
e.Item.CssClass += "lnknew";
}
break;
}
}
4-
code behind - free code
foreach (GridViewRow row in grvShowhistory.Rows)
{
row.CssClass = "lnknew";
}
this will be
<table>
<tr class="lnknew">
<td>
</td>
...
if you need to style the TD element you have to do match the element in the row
bye