private void BindGrilla() { SisPackController.AdministrarGrillas.Configurar(this.dtgDocumentosCobrados, "DocumentoCobradoAgenciaID", this.CantidadOpciones); dtgDocumentosCobrados.AllowPaging = false; if (Session["dsDocumentos"] == null) { IDocumentoCobradoAgencia gastoCA = DocumentoCobradoAgenciaFactory.GetDocumentoCobradoAgencia(); gastoCA.AgenciaID = this.AgenciaConectadaID; this.dsDocumentosCA = gastoCA.GetDocumentosCobradosAgenciasDataSet(); } else { this.dsDocumentosCA = (DsDocumentosCobradosAgencias)Session["dsDocumentos"]; if (this.dtgDocumentosCobrados.EditItemIndex != -1) { DataGridItem item = this.dtgDocumentosCobrados.Items[this.dtgDocumentosCobrados.EditItemIndex]; DsDocumentosCobradosAgencias.DatosRow dr = (DsDocumentosCobradosAgencias.DatosRow) this.dsDocumentosCA.Datos.Rows[item.DataSetIndex]; try { dr.DocumentoNro = ((TextBox)item.FindControl("txtDocumentoNro")).Text; dr.Importe = ((TextBox)item.FindControl("txtImporte")).Text == "" ? 0 : Convert.ToDouble(((TextBox)item.FindControl("txtImporte")).Text); } catch (Exception) {} dr.Observaciones = ((TextBox)item.FindControl("txtObservaciones")).Text; } } Session["dsDocumentos"] = this.dsDocumentosCA; this.dtgDocumentosCobrados.DataSource = this.dsDocumentosCA; this.dtgDocumentosCobrados.CurrentPageIndex = 0; this.dtgDocumentosCobrados.DataBind(); }