I need to check whether the cells of a particular column in gridview has certain values. If the cells contain values it should do some action. I have attached my code.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (TextBox1.Text != "")
{
if ((e.Row.Cells[3].Text == "1") && (e.Row.Cells[3].Text == "2"))
{
Label3.Visible = true;
}
}
}
}
It is not checking the AND condition. If i replace it by OR statement it works