protected void gvCarrierPolicy_RowDataBound(object sender, GridViewRowEventArgs e) { CRM.Data.Entities.LeadPolicy policy = null; decimal invoiceAmount = 0; int profileID = Convert.ToInt32(ddlInvoiceProfile.SelectedValue); if (e.Row.RowType == DataControlRowType.DataRow) { policy = e.Row.DataItem as CRM.Data.Entities.LeadPolicy; Label lblPolicyHolder = e.Row.FindControl("lblPolicyHolder") as Label; lblPolicyHolder.Text = LeadsManager.GetLeadName((int)policy.LeadId); invoiceAmount = calculateInvoiceAmount(policy); Label lblInvoiceAmount = e.Row.FindControl("lblInvoiceAmount") as Label; lblInvoiceAmount.Text = string.Format("{0:N2}", invoiceAmount); } }