I have a gridview and it bind from database ..
For example
In column 1 ,the value is zero means it displays "Not Completd"
the value is 1 means it means "Completed"
DataTable dt = (DataTable)ViewState["dvTable"];
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lbl = (e.Row.FindControl("lblStat") as Label);
Label lbltim = (e.Row.FindControl("lbladdTime") as Label);
Label lbltot = (e.Row.FindControl("lblTot") as Label);
Label lblt = (e.Row.FindControl("lblTot") as Label);
for (int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = dt.Rows[i];
if (dt.Columns.Contains("Status_"))
{
string st = dr["Status_"].ToString();
if (st == "0")
{
lbl.Text = "Not Completed";
}
else
{
lbl.Text = "Completed";
}
}
}
}
}
this i my code..
If the value is one it changes all the column cell value to "Completed"