Set borderwidth on a datagrid cell at runtime

  • Thread starter Thread starter Iain Wilson
  • Start date Start date
I

Iain Wilson

Hi All

I would like to set the width of the bottom line of a datagrid row at
runtime.

I know how to set the complete lines style color etc at runtime but I
cannot figure how to change the line.

eg

e.Item.BackColor = Color.Cornsilk;

Is it possible ?

Thanks in advance for any assistance offered

Iain
 
Hi,

Create a custom style sheet ans assign it to your row in item
databound...
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.CssClass = "customclass";
}
}

in custom css define the border type

..customclass
{
border-bottom:solid 2px gray;
}


best of luck

munna
 
Back
Top