public void BindGrid()
        {
            SisPackController.AdministrarGrillas.Configurar(this.dtgConceptosDetalle, "ConceptoLiquidacionID", this.CantidadOpciones);
            dtgConceptosDetalle.AllowPaging = false;

            if (Session["dsConceptosEntidad"] == null)
            {
                IConceptoLiquidacionDetalleEntidad conceptos = ConceptoLiquidacionDetalleEntidadFactory.GetConceptoLiquidacionDetEnt();
                conceptos.TipoEntidadComisionID = Convert.ToInt32(this.txtTipoEntidadID.Text);
                conceptos.EntidadID             = Convert.ToInt32(this.txtEntidadID.Text);
                this.dsConcepLD = conceptos.GetConceptosLiqDetalleEntidad();
            }
            else
            {
                this.dsConcepLD = (DsConceptosLiquidacionesEntidad)Session["dsConceptosEntidad"];
                if (this.dtgConceptosDetalle.EditItemIndex != -1)
                {
                    DataGridItem item = this.dtgConceptosDetalle.Items[this.dtgConceptosDetalle.EditItemIndex];
                    DsConceptosLiquidacionesEntidad.DatosRow dr = (DsConceptosLiquidacionesEntidad.DatosRow) this.dsConcepLD.Datos.Rows[item.DataSetIndex];

                    try
                    {
                        dr.FrecuenciaID = ((DropDownList)item.FindControl("ddlFrecuencia")).SelectedValue == "" ? 0 : Convert.ToInt32(((DropDownList)item.FindControl("ddlFrecuencia")).SelectedValue);
                        //dr.Importe = ((TextBox)item.FindControl("txtImporte")).Text =="" ? 0 : Convert.ToDouble(((TextBox)item.FindControl("txtImporte")).Text);
                    }
                    catch (Exception) {}
                }
            }

            Session["dsConceptosEntidad"]             = this.dsConcepLD;
            this.dtgConceptosDetalle.DataSource       = this.dsConcepLD;
            this.dtgConceptosDetalle.CurrentPageIndex = 0;
            this.dtgConceptosDetalle.DataBind();
        }
        private void dtgConceptosDetalle_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            //if (((TextBox)e.Item.FindControl("txtImporte")).Text == "0")
            //	((TextBox)e.Item.FindControl("txtImporte")).Text = "";

            Page.Validate();
            if (!Page.IsValid)
            {
                return;
            }

            this.dsConcepLD = (DsConceptosLiquidacionesEntidad)Session["dsConceptosEntidad"];
            DsConceptosLiquidacionesEntidad.DatosRow dr = (DsConceptosLiquidacionesEntidad.DatosRow) this.dsConcepLD.Datos.Rows[e.Item.DataSetIndex];

            IConceptoLiquidacionDetalleEntidad gda = ConceptoLiquidacionDetalleEntidadFactory.GetConceptoLiquidacionDetEnt();

            //gda.ConceptoLiquidacionDetalleEntidadID= dr.ConceptoLiquidacionDetalleEntidadID;
            //gda.ConceptoLiquidacionDetalleID = dr.ConceptoLiquidacionDetalleID;
            gda.ConceptoLiquidacionID = dr.ConceptoLiquidacionID;
            gda.TipoEntidadComisionID = dr.TipoEntidadComisionID;
            gda.EntidadID             = dr.EntidadID;
            gda.FrecuenciaID          = dr.FrecuenciaID;
            gda.Importe = 0;

            try
            {
                gda.Guardar();
                this.dtgConceptosDetalle.EditItemIndex = -1;
                Session["dsConceptosEntidad"]          = null;
                this.BindGrid();
            }
            catch (Exception ex)
            {
                string mensaje = ex.Message;
                try
                {
                    mensaje = this.TraducirTexto(ex.Message);
                    if (mensaje == "" || mensaje == null)
                    {
                        mensaje = ex.Message;
                    }
                }
                catch (Exception)
                {
                    mensaje = ex.Message;
                }
                ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje);
            }
        }
        private void dtgConceptosDetalle_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.EditItem)
            {
                DropDownList ddlFrecuencia = (DropDownList)e.Item.FindControl("ddlFrecuencia");
                SisPackController.LlenarCombos.FrecuenciaLiquidacion(ddlFrecuencia, this.TraducirTexto("Combos.ElijaFrecLiq"));

                PlaceHolder ph = (PlaceHolder)e.Item.FindControl("phValidFrecuencia");
                ph.Controls.Add(GenerarValidadores.Requerido("ddlFrecuencia", this.TraducirTexto("Errores.Obligatorios.FrecLiq")));

                //ph = (PlaceHolder)e.Item.FindControl("phValidImporte");

                //ph.Controls.Add(GenerarValidadores.Decimal("txtImporte", this.TraducirTexto("Errores.Invalidos.Importe")));

                DsConceptosLiquidacionesEntidad.DatosRow dr = (DsConceptosLiquidacionesEntidad.DatosRow)((DataRowView)e.Item.DataItem).Row;

                ddlFrecuencia.SelectedValue = dr.FrecuenciaID == 0 ? string.Empty : dr.FrecuenciaID.ToString();
            }
        }