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

Admin

A Software Engineer, Social Media Marketing Expert, writer,

Post a Comment

Previous Post Next Post