if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView dr = (DataRowView)e.Row.DataItem;
//Use:: if(!string.IsNullOrEmpty(dr[“Status”].ToString()))
if (dr[“Status”].ToString() != “”)
{
// hdnStatus.Value = dr[“Status”].ToString().Trim();
Label lblStValue = (Label)(e.Row.FindControl(“lblStatus”));
lblStValue.Text = dr[“Status”].ToString().Trim(); ;
if ((dr[“Status”].ToString().ToLower().Trim() == “n”) || (dr[“Status”].ToString().ToLower().Trim() == “u”))
{
((ImageButton)(e.Row.FindControl(“imgStatus”))).ImageUrl = “~/images/active.gif”;
((ImageButton)(e.Row.FindControl(“imgStatus”))).ToolTip = “Active”;
}
else
{
((ImageButton)(e.Row.FindControl(“imgStatus”))).ImageUrl = “~/images/inactive.gif”;
((ImageButton)(e.Row.FindControl(“imgStatus”))).ToolTip = “Inactive”;
}
}
}