private void GetLicenseExpireDate(string strStDate, string strEndDate) { grLicense.DataSource = objMst.GetLicenseExpireDate(strStDate, strEndDate); grLicense.DataBind(); foreach (GridViewRow gRow in grLicense.Rows) { gRow.Cells[4].Text = Common.DisplayDate(gRow.Cells[4].Text); if (Convert.ToDecimal(gRow.Cells[5].Text) == 0) { gRow.Cells[5].Text = "Today"; gRow.Cells[5].BackColor = System.Drawing.Color.LightGreen; } else if (Convert.ToDecimal(gRow.Cells[5].Text) < 0) { gRow.Cells[5].Text = "0"; } } lblLicense.Text = grLicense.Rows.Count.ToString(); if (grLicense.Rows.Count > 0) { pnlLicense.Visible = true; } else { pnlLicense.Visible = false; } }