6
Answers

ASP.NET GridView RowDataBound Event

Bineesh  VP

Bineesh VP

11y
7.8k
1
Sir, I want your help in the GridView RowDataBound Event in ASP.NET.

Let's see the gridView:-



I likes to have   BackColor  to the column- SELECT and DELETE.

I just tried a coding for this. Here the code

 protected void dgvMovie_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (e.Row.Cells[4].Text == "Select")
                {
                    e.Row.BackColor = System.Drawing.Color.LightBlue;
                }


                if (e.Row.Cells[5].Text == "Delete")
                {
                    e.Row.BackColor = System.Drawing.Color.LightBlue;
                }
            }
           
        }

So If the code have logical error, please rectify it.
Answers (6)