I have a table with three columns (ProdID, ProdName, Status). I collect this in a dataSet and bind it to my gridview. I have a very simple and simple rowdatabound event like this:
protected void gvProducts_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[2].Text == "False")
{
e.Row.BackColor = System.Drawing.Color.PaleVioletRed;
}
}
}
But when I see my third column (Status), it turns into a checkbox, maybe it contains only "True" or "False". Also in my if condition:
if (e.Row.Cells[3].Text == "False")
The text value shows this:
""
Can someone suggest me how I can compare my status with True or False in my if condition.
source
share