Set borderwidth on a datagrid cell at runtime

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
 
M

Munna

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top