Set borderwidth on a datagrid cell at runtime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Iain Wilson

    Set borderwidth on a datagrid cell at runtime

    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.BackColo r = Color.Cornsilk;

    Is it possible ?

    Thanks in advance for any assistance offered

    Iain



  • Munna

    #2
    Re: Set borderwidth on a datagrid cell at runtime

    Hi,

    Create a custom style sheet ans assign it to your row in item
    databound...
    protected void GridView1_RowDa taBound(object sender,
    GridViewRowEven tArgs e)
    {
    if (e.Row.RowType == DataControlRowT ype.DataRow)
    {
    e.Row.CssClass = "customclas s";
    }
    }

    in custom css define the border type

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


    best of luck

    munna

    Comment

    Working...