Monday, November 16, 2009

RowDataBound_ FillGrid !!

protected void GridDisplayCat_RowDataBound(object sender, GridViewRowEventArgs e)
{
{
if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Separator)
{

//Label lbldate = (Label)e.Row.Cells[1].FindControl("lbldate");
// DateTime dt = Convert.ToDateTime(lbldate.Text);
// lbldate.Text = dt.ToString("dd/MM/yyyy");

// Label lblEdate = (Label)e.Row.Cells[1].FindControl("lblEdate");
// DateTime dt1 = Convert.ToDateTime(lblEdate.Text);
// lblEdate.Text = dt1.ToString("dd/MM/yyyy");

Label lblstatus = (Label)e.Row.Cells[1].FindControl("lblstatus");
Label lblid = (Label)e.Row.Cells[2].FindControl("lblid");
string status = lblstatus.Text.ToString();
string id = lblid.Text.ToString();
if (status.ToString() == "Yes")
{
e.Row.Cells[1].Text = "\"Click";
}
else
{
e.Row.Cells[1].Text = "\"Click";
}

}
}

}

No comments: