Thursday, 31 March 2011

GridView Row Colour Change

protected void Gvattachment_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            // Display the company name in italics.
            e.Row.Cells[1].Text = "<i>" + e.Row.Cells[1].Text + "</i>";
            //Display In colour
            e.Row.Cells[2].BackColor = System.Drawing.Color.Aqua;
        }

    }

No comments:

Post a Comment