private void GetData()
{
dgParticipantList.DataSource = dataAccess.GetAllParticipants();
dgParticipantList.DataBind();
int pageCount = dgParticipantList.PageCount;
for (int pageno = 1; pageno <= pageCount; pageno++)
{
int rowCount = dgParticipantList.Items.Count;
for (int row = 0; row < rowCount; row++)
{
Literal status = dgParticipantList.Items[row].
FindControl("litStatus") as Literal;
FindControl("litStatus") as Literal;
if (status != null && status.Text.Equals("Selected"))
{
dgParticipantList.Items[row].Cells[4].BackColor = Color.Green;
dgParticipantList.Items[row].Cells[4].ForeColor = Color.White;
}
else if (status != null && status.Text.Equals("Not Selected"))
{
dgParticipantList.Items[row].Cells[4].BackColor = Color.Red;
dgParticipantList.Items[row].Cells[4].ForeColor = Color.White;
}
}
}
}
No comments:
Post a Comment