First, set the OnRowDataBound property in the markup of the GridView:
OnRowDataBound="MyGrid_RowDataBound"
Second, set the color in the OnRowDataBound handler method:
protected void MyGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
foreach (TableCell tc in e.Row.Cells)
{
tc.Attributes["style"] = "border-color: #c3cecc";
}
}
Happy Coding
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
4 comments :
Thanks so much!
Actually you can make use of border color property as
tc.bordercolor = System.Drawing.Color.Red;
good
Note: Only a member of this blog may post a comment.