Set borderwidth on a datagrid cell at runtime

Discussion in 'ASP .Net' started by Iain Wilson, Aug 7, 2008.

  1. Iain Wilson

    Iain Wilson Guest

    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
     
    Iain Wilson, Aug 7, 2008
    #1
    1. Advertising

  2. Iain Wilson

    Munna Guest

    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
     
    Munna, Aug 7, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Freeman
    Replies:
    8
    Views:
    7,722
    tcena9
    Feb 16, 2011
  2. Nathan Sokalski
    Replies:
    1
    Views:
    298
    George Ter-Saakov
    Nov 7, 2007
  3. RJ
    Replies:
    1
    Views:
    258
    Eliyahu Goldin
    Feb 17, 2005
  4. David Freeman
    Replies:
    5
    Views:
    238
    Nay Myo Aung
    Dec 27, 2004
  5. Christophe Sauvage

    BorderWidth of the control asp:ImageButton does not work in firefox

    Christophe Sauvage, Oct 5, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    143
    Christophe Sauvage
    Oct 5, 2007
Loading...

Share This Page