I am trying to change the color of the horizontal and the vertical lines of an asp .net gridview. I am changing the cell border color but only the horizontal lines are changed. You can see a picture attached.
You can use RowDataBound:
protected void gridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
{
foreach (TableCell tc in e.Row.Cells)
{
tc.Attributes["style"] = "border-right:3px solid red; border-bottom:3px solid blue";
}
}
Of course you can also use CSS classes(via tc.CssClass) instead of the inline css.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With