B
bbawa1
Hi,
I have the following code. but if just goes to first if Statement
where I make comparison. but it doesn't go to second if statement.
Colul u please help me with that.
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
//DateTime enddate = DateTime.Now;
//TimeSpan duration = enddate -
Convert.ToDateTime(e.Row.Cells[1]);
if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 17) &&
(Convert.ToInt32(e.Row.Cells[2].Text) <= 23))
{
e.Row.Cells[0].CssClass = "sdgStatusOrange";
}
if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 27) &&
(Convert.ToInt32(e.Row.Cells[2].Text) <=29))
{
e.Row.Cells[0].CssClass = "sdgStatusYellow";
}
if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 30) &&
(Convert.ToInt32(e.Row.Cells[2].Text) <=32))
{
e.Row.Cells[0].CssClass = "sdgStatusBlue";
}
I have the following code. but if just goes to first if Statement
where I make comparison. but it doesn't go to second if statement.
Colul u please help me with that.
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
//DateTime enddate = DateTime.Now;
//TimeSpan duration = enddate -
Convert.ToDateTime(e.Row.Cells[1]);
if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 17) &&
(Convert.ToInt32(e.Row.Cells[2].Text) <= 23))
{
e.Row.Cells[0].CssClass = "sdgStatusOrange";
}
if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 27) &&
(Convert.ToInt32(e.Row.Cells[2].Text) <=29))
{
e.Row.Cells[0].CssClass = "sdgStatusYellow";
}
if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 30) &&
(Convert.ToInt32(e.Row.Cells[2].Text) <=32))
{
e.Row.Cells[0].CssClass = "sdgStatusBlue";
}