Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Set borderwidth on a datagrid cell at runtime

Reply
Thread Tools

Set borderwidth on a datagrid cell at runtime

 
 
Iain Wilson
Guest
Posts: n/a
 
      08-07-2008
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



 
Reply With Quote
 
 
 
 
Munna
Guest
Posts: n/a
 
      08-07-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid - BorderStyle="None" and BorderWidth="None" doesn't work for Firefox David Freeman ASP .Net 8 02-16-2011 11:03 AM
Image adding border-width:0; when I do not specify the BorderWidth property Nathan Sokalski ASP .Net 1 11-07-2007 04:30 PM
BorderWidth of the control asp:ImageButton does not work in firefox Christophe Sauvage ASP .Net Web Controls 0 10-05-2007 08:44 AM
How to set cell background based on cell value when datagrid is displayed RJ ASP .Net Datagrid Control 1 02-17-2005 09:37 PM
DataGrid - BorderStyle="None" and BorderWidth="None" doesn't work for Firefox David Freeman ASP .Net Web Controls 5 12-27-2004 05:27 AM



Advertisments