protected void G_PRODUCTOS_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string vendedor = G_PRODUCTOS.DataKeys[e.Row.RowIndex].Values[2].ToString(); string cliente = G_PRODUCTOS.DataKeys[e.Row.RowIndex].Values[3].ToString(); clsCrypto.CL_Crypto encriptador = new clsCrypto.CL_Crypto("thi"); //encriptador.EncryptData( e.Row.Cells[1].Attributes["onclick"] = "javascript:fuera('" + encriptador.EncryptData(PERIODOS) + "', '" + encriptador.EncryptData(vendedor) + "', '" + encriptador.EncryptData(cliente) + "', '" + encriptador.EncryptData("4") + "');return false;"; double sum_por_row = 0; for (int i = 5; i <= colum; i++) { double d; double.TryParse(e.Row.Cells[i + 1].Text, out d); sum_por_row += d; } e.Row.Cells[colum + 2].Text = sum_por_row.ToString("N0"); e.Row.Cells[0].Text = cont_det.ToString(); cont_det++; e.Row.Cells[2].Visible = false; e.Row.Cells[3].Visible = false; G_PRODUCTOS.HeaderRow.Cells[2].Visible = false; G_PRODUCTOS.HeaderRow.Cells[3].Visible = false; if (header_sum) { periodo1 = ReporteRNegocio.Facturación_Mes_precalculado1(USER);; periodo2 = ReporteRNegocio.Facturación_Mes_precalculado2(USER);; periodo3 = ReporteRNegocio.Facturación_Mes_precalculado3(USER);; periodo4 = ReporteRNegocio.Facturación_Mes_precalculado4(USER);; periodo1_ = ReporteRNegocio.pregunta_periodo_prod(USER, "1"); periodo2_ = ReporteRNegocio.pregunta_periodo_prod(USER, "2"); periodo3_ = ReporteRNegocio.pregunta_periodo_prod(USER, "3"); periodo4_ = ReporteRNegocio.pregunta_periodo_prod(USER, "4"); header_sum = false; } List <string> periodos_list = PERIODOS.Split(',').ToList(); G_PRODUCTOS.HeaderRow.Cells[4].Text = "Vendedor"; G_PRODUCTOS.HeaderRow.Cells[3].Text = "Producto"; G_PRODUCTOS.HeaderRow.Cells[5].Text = "Cliente"; G_PRODUCTOS.HeaderRow.Cells[6].Text = periodo1_ + " (" + Double.Parse(periodo1).ToString("N0") + ") "; G_PRODUCTOS.HeaderRow.Cells[7].Text = periodo2_ + " (" + Double.Parse(periodo2).ToString("N0") + ") "; G_PRODUCTOS.HeaderRow.Cells[8].Text = periodo3_ + " (" + Double.Parse(periodo3).ToString("N0") + ") "; G_PRODUCTOS.HeaderRow.Cells[9].Text = periodo4_ + " (" + Double.Parse(periodo4).ToString("N0") + ") "; G_PRODUCTOS.HeaderRow.Cells[6].Attributes["data-sort-method"] = "number"; G_PRODUCTOS.HeaderRow.Cells[7].Attributes["data-sort-method"] = "number"; G_PRODUCTOS.HeaderRow.Cells[8].Attributes["data-sort-method"] = "number"; G_PRODUCTOS.HeaderRow.Cells[9].Attributes["data-sort-method"] = "number"; G_PRODUCTOS.HeaderRow.Cells[10].Attributes["data-sort-method"] = "number"; try { if (G_PRODUCTOS.HeaderRow.Cells[6].Text.Contains("Error")) { G_PRODUCTOS.HeaderRow.Cells[6].Attributes["style"] = "display: none;"; e.Row.Cells[6].Attributes["style"] = "display: none;"; } if (G_PRODUCTOS.HeaderRow.Cells[7].Text.Contains("Error")) { G_PRODUCTOS.HeaderRow.Cells[7].Attributes["style"] = "display: none;"; e.Row.Cells[7].Attributes["style"] = "display: none;"; } if (G_PRODUCTOS.HeaderRow.Cells[8].Text.Contains("Error")) { G_PRODUCTOS.HeaderRow.Cells[8].Attributes["style"] = "display: none;"; e.Row.Cells[8].Attributes["style"] = "display: none;"; } if (G_PRODUCTOS.HeaderRow.Cells[9].Text.Contains("Error")) { G_PRODUCTOS.HeaderRow.Cells[9].Attributes["style"] = "display: none;"; e.Row.Cells[9].Attributes["style"] = "display: none;"; } } catch { } } }