Quote:
Actually I made it to add the image but I need the syntax to check if the checklist is already have a milestone_code
, an image of checklist icon will appear and if not yet assigned, it has no image. Please extend your help to me :)
You can use
GridView.RowDataBound Event[
^].
void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
string milestone_code = DataBinder.Eval(e.Row.DataItem, "milestone_code").ToString();
if(string.IsNullOrEmpty(milestone_code))
{
Image imgs = e.Row.FindControl("imgs") as Image;
imgs.Visible = false;
}
}
Also declare this Event in
GridView
Markup like...
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" ............