Pages

Subscribe:

Ads 468x60px

Tuesday, February 28, 2012

how to add style on Grid Rows in asp.net using c#

if you want to add style on Grid Rows in asp.net using c# just copy and past the below code in your .cs file.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (e.Row.RowType == DataControlRowType.DataRow)
        {

e.Row.Cells[1].Style.Add(HtmlTextWriterStyle.Position, "relative");
e.Row.Cells[1].Style.Add(HtmlTextWriterStyle.Overflow, "auto");
e.Row.Cells[1].Style.Add(HtmlTextWriterStyle.BackgroundColor, "White");
}
}

Click herefor More Solutions

No comments:

Post a Comment