Hi,
Can get my code working fully. its just works partially.
Its a IF else statement, the value to the variable is to be read from a cell with intergers from 0 to 9, it works ok for value 4 = Open, but rest it not working.
int MST = Convert.ToInt32(Convert.ToInt32(DetailsView3.Rows[0].Cells[1].Text));
if (MST == 0)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 1)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Order";
}
else if (MST == 2)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Order";
}
else if (MST == 3)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Open";
}
else if (MST == 4)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Green;
DetailsView2.Rows[3].Cells[1].Text = "Open";
}
else if (MST == 5)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 6)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 7)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 8)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
else if (MST == 9)
{
DetailsView2.Rows[3].Cells[1].ForeColor = Color.Red;
DetailsView2.Rows[3].Cells[1].Text = "Closed";
}
Thank u.