protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { // NEW/UPDATE if (e.Column.FieldName == "Id") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Usuario") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaCreacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "UsuarioCreacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaModificacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "UsuarioModificacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "IdUsuario.Nombre") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } // IF NEW if (this.ASPxGridView1.IsNewRowEditing) { if (e.Column.FieldName == "IdEvento.Descripcion") { e.Editor.ReadOnly = false; e.Editor.BackColor = System.Drawing.Color.White; } } // Upload Combos /* if (e.Column.FieldName == "IdEvento.Descripcion") { ASPxComboBox cmb = e.Editor as ASPxComboBox; cmb.DataSource = bllEvento.ReadAll(); cmb.DataBindItems(); } */ }
protected void gvRooms_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName != "BedTypeId") return; ASPxComboBox combo = e.Editor as ASPxComboBox; combo.DataBindItems(); }
protected void gvServiceMethods_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName != "ServiceMethodID") return; ASPxComboBox combo = e.Editor as ASPxComboBox; combo.DataBindItems(); }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "idControlHorario") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "colaborador") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nombre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (!this.ASPxGridView1.IsNewRowEditing) { if (this.ASPxGridView1.IsEditing && e.Column.FieldName == "colaborador" && !String.IsNullOrEmpty(e.Editor.Value.ToString())) { ASPxPageControl Tabs = (ASPxPageControl)ASPxGridView1.FindEditFormTemplateControl("pageControl"); Colaborador colaborador = this.colaboradorBL.consultarId(new Colaborador(Int32.Parse(e.Editor.Value.ToString()))); if (colaborador != null) { //ASPxPageControl Tabs = (ASPxPageControl)ASPxGridView1.FindEditFormTemplateControl("pageControl"); ASPxComboBox cmbColaborador = (ASPxComboBox)Tabs.FindControl("cmbColaborador"); cmbColaborador.Items.Add(colaborador.ToString(), colaborador.idColaborador); cmbColaborador.SelectedIndex = 0; } } } }
protected void gdvEstoque_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "IdProduto") { e.Editor.Focus(); } }
protected void grid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (!grid.IsEditing || e.Column.FieldName != "ProjectID") return; var combo = ((ASPxComboBox)e.Editor); combo.Callback += new CallbackEventHandlerBase(cmbProject_Callback); }
protected void gvFeatureList_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName != "OptionCategoryId") return; ASPxComboBox combo = e.Editor as ASPxComboBox; combo.DataBindItems(); }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "idFeriado") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "idCajaChica") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "colaborador") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nombre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "diaSolicitud") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } }
/// <summary> /// desabilita los campos que no son editables, en este metodo siempre van a ser esos valores mas la llave /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { //al crear uno nuevo la y la llve no es autonumerica se deshabilita if (this.ASPxGridView1.IsNewRowEditing){ if (e.Column.FieldName == "idUsuario") { e.Editor.ReadOnly = false; e.Column.ReadOnly = false; e.Editor.BackColor = System.Drawing.Color.White; } }else{//en modificacion de habilita if (e.Column.FieldName == "idUsuario") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } } //valores de auditoria if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (this.ASPxGridView1.IsNewRowEditing) { if (e.Column.FieldName == "idCuenta") { e.Editor.ReadOnly = false; e.Column.ReadOnly = false; e.Editor.BackColor = System.Drawing.Color.White; } } else { if (e.Column.FieldName == "idCuenta") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } }
protected void grd_Journal_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName.Equals("AccountId!Key")) { try { ASPxComboBox accountCombobox = e.Editor as ASPxComboBox; accountCombobox.TextField = "Code"; accountCombobox.DataSource = AccountingBO.getNotParentAccountCollection(session); accountCombobox.DataBind(); } catch (Exception) { } } }
protected void grid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "ProductName") { e.Editor.SetClientSideEventHandler("Init", "ProductNameEditorInit"); } if (e.Editor is ASPxTextBox) { e.Editor.SetClientSideEventHandler("KeyDown", "TextBoxKeyDown"); e.Editor.SetClientSideEventHandler("KeyUp", "TextBoxKeyUp"); } else { e.Editor.SetClientSideEventHandler("ValueChanged", "EditorValueChanged"); } }
protected void grdvInfiltrados_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (string.Compare(e.Column.FieldName, "U_DXP_COD_ABONADO", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ABONADO", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_PLAN_INT", false) == 0 || string.Compare(e.Column.FieldName, " U_DXP_ESTADO_INT", false) == 0) { e.Editor.ReadOnly = true; } else { e.Editor.ReadOnly = false; } }
protected void grvEmpleados_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { ASPxGridView grid = sender as ASPxGridView; //Make sure that the code initializing editor values in EditForm is executed only once - when switching the grid to edit mode if (!(grid.IsEditing && isEditing)) { return; } if (grid.Selection.Count == 1 || e.Column.ReadOnly) { return; } //Initialize an editor's value depending upon the value's uniqueness within a column e.Editor.Value = IsCommonValueForAllSelectedRows(e.Column, e.Value) ? e.Value : null; }
protected void grdInputCommLine_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "LotId!Key") { ASPxComboBox combo = (ASPxComboBox)e.Editor; combo.ClientSideEvents.ValueChanged = "function(s,e){ " + "var a = s.GetSelectedItem().GetColumnText('ExpireDate').substring(0,10).split('/');" + "var d = new Date(a[2], a[1]-1, a[0]);" + "grdInputCommLine.GetEditor('LotId.ExpireDate').SetValue(d);" + "}"; //combo.ItemsRequestedByFilterCondition += new ListEditItemsRequestedByFilterConditionEventHandler(cboLot_ItemsRequestedByFilterCondition); //combo.ItemRequestedByValue += new ListEditItemRequestedByValueEventHandler(cboLot_ItemRequestedByValue); } }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "idVacaciones") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "colaborador") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nombre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "diaSolicitud") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "estado" && e.Editor.Value.Equals(EstadoVacaciones.CANCELADO.ToString())) { if (e.Column.FieldName == "estado") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } } }
protected void grdRegionOrganization_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { //if (e.Column.FieldName == "Name") //{ // ASPxComboBox comboBox = e.Editor as ASPxComboBox; // if (comboBox != null) // { // List<SYS_Province> lstProvince = new List<SYS_Province>(); // lstProvince = isProvinceService.SelectAllSYS_Province(); // comboBox.DataSource = lstProvince; // comboBox.ValueField = "ID"; // comboBox.TextField = "Name"; // comboBox.DataBind(); // } //} }
protected void grillaTandaItem_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.Name.Equals("codigoTalle")) { ASPxComboBox combo = e.Editor as ASPxComboBox; combo.Callback += new CallbackEventHandlerBase(ComboTalle_OnCallback); if (e.KeyValue == DBNull.Value || e.KeyValue == null) { return; } combo.DataBind(); } }
protected void grdGeneralJournal_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName.Equals("Description")) { e.Editor.Focus(); } else if (e.Column.FieldName.Equals("AccountId!Key")) { ASPxComboBox accountComboBox = (ASPxComboBox)e.Editor; if (accountComboBox != null) { accountComboBox.DataSource = AccountingBO.getNotParentAccountList(session); accountComboBox.DataBindItems(); } } }
protected void EmployeesGrid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { ASPxGridView grid = sender as ASPxGridView; if (grid.IsNewRowEditing) { if (e.Column.FieldName == "DokumanAdi") { e.Editor.ReadOnly = !grid.IsNewRowEditing; } if (e.Column.FieldName == "DokumanTipi_TipID5") { e.Editor.ReadOnly = !grid.IsNewRowEditing; } } }
protected void gv_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Editor is ASPxMemo && e.Value != null) { string text = e.Value.ToString(); string[] words = text.Split(new char[] { ' ' }); for (int i = 0; i < words.Length; i++) { if (words[i].Length > 5) { words[i] += "a"; } } e.Editor.Value = string.Join(" ", words); } }
protected void grid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (this.grid.EditingRowVisibleIndex > -1) { ASPxTextBox txt_Code = this.grid.FindEditRowCellTemplateControl(null, "txt_Code") as ASPxTextBox; ASPxTextBox txt_RemainingLimit = this.grid.FindEditRowCellTemplateControl(null, "txt_RemainingLimit") as ASPxTextBox; if (txt_Code != null && txt_RemainingLimit != null) { txt_Code.ReadOnly = true; txt_Code.Border.BorderWidth = 0; txt_RemainingLimit.ReadOnly = true; txt_RemainingLimit.Border.BorderWidth = 0; } } }
protected void grdvPrecios_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (string.Compare(e.Column.FieldName, "ListNum", false) == 0 || string.Compare(e.Column.FieldName, "ListName", false) == 0) { e.Editor.ReadOnly = true; } else { e.Editor.ReadOnly = false; } if (string.Compare(e.Column.FieldName, "Price", false) == 0) { e.Editor.Focus(); } }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "codigo") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; e.Editor.Value = Session["usuario"].ToString(); } if (this.ASPxGridView1.IsNewRowEditing) { if (e.Column.FieldName == "estado") { e.Editor.Value = Estado.ACTIVO.ToString(); } } }
public static void MakeColumnReadOnlyWhileEditing(object sender, ASPxGridViewEditorEventArgs e, string fieldName) { MVCxGridView grid = sender as MVCxGridView; if (grid.IsNewRowEditing) { return; } if (grid.IsEditing) { if (e.Column.FieldName.Equals(fieldName, StringComparison.OrdinalIgnoreCase) && (long)e.KeyValue > 0) { e.Editor.ClientEnabled = false; } } }
protected void gvSalesForecastUpdated_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (gvSalesForecastUpdated.IsNewRowEditing) { return; } string column = e.Column.FieldName; ASPxEditBase editor = e.Editor; EditModeDisableColumns(column, editor); // Disable editing of non-base-part-closeout columns if (column == "VerifiedEop") { EditModePopulateVerifiedEop(editor); // Populate the VerifiedEOP combobox } //if (column == "SchedulerResponsible") EditModePopulateSchedulerResponsible(editor); // Populate the SchedulerResponsible combobox }
protected void gvRegisterStud_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (cmbProgram.SelectedIndex >= 0) { if (e.Column.Name == "ClassShud") { ASPxComboBox c = e.Editor as ASPxComboBox; //gvClassLessons.FindEditRowCellTemplateControl(gvClassLessons.Columns["TutorName"] as GridViewDataComboBoxColumn, "lbTutorList2") c.TextField = "Title"; c.ValueField = "ID"; //*******var lessonID = gvClassLessons.GetRowValuesByKeyValue(e.KeyValue,"LessonID"); c.DataSource = new ClassSchedulerServices().GetAllClassSchedulerByClassIDAvailable(int.Parse(gvRegisterStud.GetRowValuesByKeyValue(e.KeyValue, "ID").ToString()), new SessionManager().GetUserId(Session)); c.DataBind(); } } UpdateRegistration.Update(); }
protected void gdvHijos_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (string.Compare(e.Column.FieldName, "ItemName", false) == 0 || string.Compare(e.Column.FieldName, "Warehouse", false) == 0 || string.Compare(e.Column.FieldName, "InvntryUom", false) == 0) { e.Editor.ReadOnly = true; } else { e.Editor.ReadOnly = false; } if (string.Compare(e.Column.FieldName, "Code", false) == 0) { e.Editor.Focus(); } }
protected void GridView_Asignaciones_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { try { if (e.Column.FieldName == "IdBeneficiario") { if (Session["IdNuevoBeneficiario"] != null) { e.Editor.Value = Session["IdNuevoBeneficiario"]; } } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
protected void grid_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName != "CategoryName") { return; } if (e.Editor is ASPxComboBox) { if (Session[GetSessionFilterName(e.Column)] != null) { ((ASPxComboBox)e.Editor).Text = Session[GetSessionFilterName(e.Column)].ToString(); } else { ((ASPxComboBox)e.Editor).Text = ShowAllFilterId; } } }
protected void ASPxGridViewDemo_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column != null && e.Column.FieldName == "Type") { ASPxComboBox comboBox = (ASPxComboBox)e.Editor; ASPxGridView gridView = (ASPxGridView)sender; IssueType issueType = (IssueType)gridView.GetRowValuesByKeyValue(e.KeyValue, "IssueTypeName"); /*var filterValues = from issue in Issues * where issue.Type == issueType * select issue;*/ var filterValues = Issues.Where(issue => issue.Type == issueType); comboBox.DataSource = filterValues; comboBox.DataBindItems(); } }
protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { // NEW/UPDATE if (e.Column.FieldName == "Id") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "IdEvento.Descripcion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "IdAsociado.Id") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Nombre") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "NumeroCedula") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Confirmado") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Estado") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Correo") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Telefono") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaCreacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "UsuarioCreacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaModificacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "UsuarioModificacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaAsistencia") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "idPagoPendiente") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "aplicaRebajoCCSS") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "colaborador") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nombre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "estado" && e.Editor.Value.Equals(PagoPendiente.CANCELADO)) { if (e.Column.FieldName == "estado") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } } }
protected void grid_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (!IsCustomColumnFiltering(e.Column)) { return; } if (e.Editor is ASPxComboBox) { if (Session[GetSessionFilterName(e.Column)] != null) { ((ASPxComboBox)e.Editor).SelectedIndex = (int)Session[GetSessionFilterName(e.Column)] + 1; // + 1 for "Show All" } else { ((ASPxComboBox)e.Editor).SelectedIndex = 0; //Show All, set the SelectedIndex to -1 to show the empty string for "Show all" } } }
protected void TravelerHAGrid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { /* if (e.Column.FieldName == "ServerType") * { * ASPxComboBox ServerTypeComboBox = e.Editor as ASPxComboBox; * FillServerTypeComboBox(ServerTypeComboBox); * ServerTypeComboBox.Callback += new CallbackEventHandlerBase(ServerTypeComboBox_OnCallback); * * * ASPxListBox txtTestScan = (ASPxListBox)TravelerHAGrid.FindEditFormTemplateControl("TestScanComboBox"); * txtTestScan.TextField = "TestScanServer"; * txtTestScan.ValueField = "TestScanServer"; * txtTestScan.DataSource = VSWebBL.ConfiguratorBL.TravelerBL.Ins.GetTravelerTestWhenScan(); * * * * } * */ }
protected void gvxOpperation_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { try { int opperationID = int.Parse(ViewState["OpperatioinID"].ToString()); ASPxDropDownEdit dd = (ASPxDropDownEdit)gvxOpperation.FindEditFormTemplateControl("ddMaterails"); ASPxCheckBoxList list = (ASPxCheckBoxList)dd.FindControl("chlMaterails"); dsOpperationMaterails.SelectParameters[0].DefaultValue = opperationID.ToString(); DataView SelectedItemView = (DataView)dsOpperationMaterails.Select(new DataSourceSelectArguments()); DataTable SelectedItems = SelectedItemView.ToTable(); foreach (DataRow item in SelectedItems.Rows) { list.Items.FindByValue(item[0].ToString()).Selected = true; } } catch (Exception) { } }
protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "smes") { ASPxComboBox cmb = e.Editor as ASPxComboBox; cmb.Items.Add("JAN"); cmb.Items.Add("FEB"); cmb.Items.Add("MAR"); cmb.Items.Add("APR"); cmb.Items.Add("MAY"); cmb.Items.Add("JUN"); cmb.Items.Add("JUL"); cmb.Items.Add("AUG"); cmb.Items.Add("SEP"); cmb.Items.Add("OCT"); cmb.Items.Add("NOV"); cmb.Items.Add("DEC"); } }
protected void Grid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "CityID") { var combo = (ASPxComboBox)e.Editor; combo.Callback += new CallbackEventHandlerBase(combo_Callback); var grid = e.Column.Grid; if (!combo.IsCallback) { var countryID = -1; if (!grid.IsNewRowEditing) { countryID = (int)grid.GetRowValues(e.VisibleIndex, "CountryID"); } FillCitiesComboBox(combo, countryID); } } }
protected void grdvRegistroOnus_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if ( string.Compare(e.Column.FieldName, "U_DXP_ONU_CODABO", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ONU_TARJETA", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ONU_PUERTO", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ONU_ABONADO", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_COD_ONU", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ONU_ESTADO", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ABO_MIKROT", false) == 0 || string.Compare(e.Column.FieldName, "U_DXP_ONU_TYPE", false) == 0) { e.Editor.ReadOnly = true; } else { e.Editor.ReadOnly = false; } }
//protected void ddlConceptoPago_Callback(object sender, CallbackEventArgsBase e) //{ // if (e.Parameter == "cargarConcepto") // { // DataTable dt = CargarDdlConcepto(); // util.CargaDDLDx(ddlConceptoPago, dt, "ConceptoPago", "IdDestino"); // } //} protected void gvDetalleMov_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "IdDetalle") { var combo = (ASPxComboBox)e.Editor; combo.Callback += new CallbackEventHandlerBase(Detalle); var grid = e.Column.Grid; if (!combo.IsCallback) { var DescDetalle = -1; if (!grid.IsNewRowEditing) { DescDetalle = (int)grid.GetRowValues(e.VisibleIndex, "IdDestino"); } Concepto(combo, DescDetalle); } } }
protected void grid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { switch (e.Column.FieldName) { case "Category2ID": InitializeCombo(e, "Category1ID", dsCategory2, cmbCombo2_OnCallback); break; case "Category3ID": InitializeCombo(e, "Category2ID", dsCategory3, cmbCombo3_OnCallback); break; case "Category4ID": InitializeCombo(e, "Category3ID", dsCategory4, cmbCombo4_OnCallback); break; default: break; } }
protected void gdvinv1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (string.Compare(e.Column.FieldName, "ItemCode", false) == 0 || string.Compare(e.Column.FieldName, "PriceBefDi", false) == 0 || string.Compare(e.Column.FieldName, "Quantity", false) == 0 || string.Compare(e.Column.FieldName, "DiscPrcnt", false) == 0) { e.Editor.ReadOnly = false; } else { e.Editor.ReadOnly = true; } if (string.Compare(e.Column.FieldName, "ItemCode", false) == 0) { e.Editor.Focus(); } gdvinv1.JSProperties["cpSubTotal"] = ((List <BEDocumentLine>)Session["inv1"]).Sum(item => Math.Round(item.LineTotal, 2)); }
protected void GridTouristUnitView_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "SiteCode") { ASPxComboBox combo = (ASPxComboBox)e.Editor; combo.DataSource = controller.GetSiteCodes(); combo.DataBind(); // Combo SiteCode nije moguce mjenjati u edit modu ( mjenjanje je moguce samo kod kreiranja novog recorda) combo.Enabled = e.Column.Grid.IsNewRowEditing; } if (!e.Column.Grid.IsNewRowEditing) { //Kod editiranja UnitCode nije moguce mjenjati i zato je ReadOnli if (e.Column.FieldName == "UnitCode") { e.Editor.ReadOnly = true; } } }
protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { // NEW/UPDATE if (e.Column.FieldName == "Id") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "Usuario") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaCreacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "UsuarioCreacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "FechaModificacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } if (e.Column.FieldName == "UsuarioModificacion") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } // IF NEW if (this.ASPxGridView1.IsNewRowEditing) { if (e.Column.FieldName == "Usuario") { e.Editor.ReadOnly = false; e.Editor.BackColor = System.Drawing.Color.White; } if (e.Column.FieldName == "Estado") { e.Editor.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGreen; } } // Upload Combos if (e.Column.FieldName == "Role") { ASPxComboBox cmb = e.Editor as ASPxComboBox; cmb.DataSource = Enum.GetValues(typeof(Role)); cmb.DataBindItems(); } if (e.Column.FieldName == "Estado") { ASPxComboBox cmb = e.Editor as ASPxComboBox; cmb.DataSource = Enum.GetValues(typeof(UserState)); cmb.DataBindItems(); } }
protected void gvServiceInformation_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName != "AdditionalServiceId") return; ASPxComboBox combo = e.Editor as ASPxComboBox; combo.DataBindItems(); }
/// <summary> /// bind port combo when editting /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void dxgrdETA_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "DestinationPortID") { ASPxComboBox _combo = (ASPxComboBox)e.Editor; string[] _cols = { "PortTable.PortID, PortTable.PortName" }; string[] _order = { "PortName" }; SubSonic.SqlQuery _qry = new SubSonic.SqlQuery(); _qry = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.PortTable).OrderAsc(_order); //bind origin ports IDataReader _rd = _qry.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "PortID"; _combo.ValueType = typeof(int); _combo.TextField = "PortName"; _combo.DataBindItems(); } }
//protected void ASPxButton1_Click(object sender, EventArgs e) //{ // ScriptManager.RegisterStartupScript(this, this.GetType(), "View_ODS", "View_ODS();", true); //} protected void viewODS_PROGRAM_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { Col_Read(); if (!string.IsNullOrEmpty(OPM_BL._ValidateProgram)) { ASPxGridView viewODSGrid = (ASPxGridView)sender; GridViewDataTextColumn columnx = ((DevExpress.Web.ASPxGridView.GridViewDataTextColumn)viewODSGrid.Columns["PRG_ID"]); if (e.Column.FieldName == "PRG_ID") { ASPxTextBox txt_PRG_ID = e.Editor as ASPxTextBox; txt_PRG_ID.Enabled = true; } } else { ASPxGridView viewODSGrid = (ASPxGridView)sender; GridViewDataTextColumn columnx = ((DevExpress.Web.ASPxGridView.GridViewDataTextColumn)viewODSGrid.Columns["PRG_ID"]); if (e.Column.FieldName == "PRG_ID") { ASPxTextBox txt_PRG_ID = e.Editor as ASPxTextBox; txt_PRG_ID.Enabled = false; } } }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "idColaborador") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (this.ASPxGridView1.IsNewRowEditing) { if (e.Column.FieldName == "nacionalidad") { e.Editor.Value = 29; this.cargarProvincias(); //si es unno nuevo solo le carga las provincias } if (e.Column.FieldName == "estado") { e.Editor.Value = "ACTIVO"; } } else {/****************** CUANDO ES UNA MODIFICACION *******************/ //si es una modificacion carga todos this.cargarProvincias(); //si es unno nuevo solo le carga las provincias if (this.ASPxGridView1.IsEditing && e.Column.FieldName == "idColaborador" && !String.IsNullOrEmpty(e.Editor.Value.ToString())) { String entro = Session["entro"] != null ? Session["entro"].ToString() : "NO"; if (entro.Equals("NO")) { Session["entro"] = "SI"; Colaborador colaborador = this.colaboradorBL.consultarId(new Colaborador(Int32.Parse(e.Editor.Value.ToString()))); ASPxPageControl Tabs = (ASPxPageControl)ASPxGridView1.FindEditFormTemplateControl("pageControl"); /* PROVINCIAS */ ASPxComboBox comboProvincia = (ASPxComboBox)Tabs.FindControl("provincia"); comboProvincia.Value = colaborador.provincia.idProvincia; /* CANTON */ ASPxComboBox comboCanton = (ASPxComboBox)Tabs.FindControl("canton"); comboCanton.Items.Clear(); if (comboCanton != null) { foreach (Canton dato in this.cantonBL.consultarProvincia(new Provincia(colaborador.provincia.idProvincia))) { comboCanton.Items.Add(dato.ToString(), dato.idCanton); } } comboCanton.IncrementalFilteringMode = IncrementalFilteringMode.Contains; comboCanton.Value = colaborador.canton.idCanton; /* DISTRITO */ ASPxComboBox comboDistrito = (ASPxComboBox)Tabs.FindControl("distrito"); comboDistrito.Items.Clear(); if (comboDistrito != null) { foreach (Distrito dato in this.distritoBL.consultarXDistrito(colaborador.provincia.idProvincia, colaborador.canton.idCanton)) { comboDistrito.Items.Add(dato.ToString(), dato.idDistrito); } } comboDistrito.IncrementalFilteringMode = IncrementalFilteringMode.Contains; comboDistrito.Value = colaborador.distrito.idDistrito; }// if (entro.Equals("NO")) { } } }
protected void GRIDFORNECEDORES_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { e.Editor.ClientInstanceName = e.Column.FieldName; }
protected void viewODS_SYSTEM_ROLE_ListView_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (viewODS_SYSTEM_ROLE_ListView.FocusedRowIndex != -1) { if (!string.IsNullOrEmpty(_KeepNewRole)) { ASPxGridView viewODSGrid = (ASPxGridView)sender; GridViewDataTextColumn columnx = ((DevExpress.Web.ASPxGridView.GridViewDataTextColumn)viewODSGrid.Columns["ROLE_ID"]); if (e.Column.FieldName == "ROLE_ID") { ASPxTextBox txt_ROLE_ID = e.Editor as ASPxTextBox; txt_ROLE_ID.Enabled = true; } } else { ASPxGridView viewODSGrid = (ASPxGridView)sender; GridViewDataTextColumn columnx = ((DevExpress.Web.ASPxGridView.GridViewDataTextColumn)viewODSGrid.Columns["ROLE_ID"]); if (e.Column.FieldName == "ROLE_ID") { ASPxTextBox txt_ROLE_ID = e.Editor as ASPxTextBox; txt_ROLE_ID.Enabled = false; } } } }
protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "idAusencia") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "estudiante") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "estudianteNombre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaAusencia") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "lecciones") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "trimestre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "ofertaAcademica") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } }
protected void dxgvItemList_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { try { if (e.Column.Caption=="Description") { (e.Editor as ASPxTextBox).Height = Unit.Pixel(24); (e.Editor as ASPxTextBox).Font.Size = FontUnit.Small; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void dxgvItemList_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvPaymentInformation_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (gvPaymentInformation.IsEditing) { if (e.Editor.ClientInstanceName == "ColType") { if (((DevExpress.Web.ASPxEditors.ASPxComboBox)(e.Editor)).SelectedItem != null && ((DevExpress.Web.ASPxEditors.ASPxComboBox)(e.Editor)).SelectedItem.Text == "Credit Card") { ViewState["currentType"] = "Credit Card"; } else { ViewState["currentType"] = string.Empty; } } else { if (ViewState["currentType"].ToString() == "Credit Card") { if (e.Column.FieldName == "CreditCardTypeId") { e.Editor.Enabled = true; } if (e.Column.FieldName == "CCNo") { e.Editor.Enabled = true; } if (e.Column.FieldName == "CCExpirationDate") { e.Editor.Enabled = true; } if (e.Column.FieldName == "CCNameOnCard") { e.Editor.Enabled = true; } } else { if (e.Column.FieldName == "CreditCardTypeId") { e.Editor.Enabled = false; } if (e.Column.FieldName == "CCNo") { e.Editor.Enabled = false; } if (e.Column.FieldName == "CCExpirationDate") { e.Editor.Enabled = false; } if (e.Column.FieldName == "CCNameOnCard") { e.Editor.Enabled = false; } } } } if (e.Column.FieldName != "PaymentTypeId" && e.Column.FieldName != "CreditCardTypeId" && e.Column.FieldName != "CurrencyId") return; ASPxComboBox combo = e.Editor as ASPxComboBox; combo.DataBindItems(); }
/// <summary> /// desabilita los campos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridView1_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "identificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "NombreEstudiante") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "idEstudiante") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "matricula") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nivel") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } //Verifica los periodos en caso de que el periodo sea igual al activo entonces verifica las fechas de registro de notas if ((cmbPeriodo.Text == periodoActivo)) { //Verfica las fechas si la fecha actual está entre el rango de fechas permitidas entonces desbloquea los campos de escritura if (!(DateTime.Today <= fechaFinalRegistroNotas && DateTime.Today >= fechaInicialRegistroNotas)) { //Si el estudiante posee notas de convalidacion de este mismo curso entonces se bloquearán caso contrario desbloquea los campos editables if (e.Column.FieldName == "nota1T") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota2T") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota3T") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota1C") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota2C") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } } } else { if (e.Column.FieldName == "nota1T") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota2T") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota3T") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota1C") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "nota2C") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } } }
protected override void RaiseEditorInitialize(ASPxGridViewEditorEventArgs e) { OnEditorInitialize_BaseImplementation(e); base.RaiseEditorInitialize(e); }
/// <summary> /// Tao option All /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gridSms_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "SmsType") { // Create option All for combobox Services var comboBox = e.Editor as ASPxComboBox; if (comboBox != null) comboBox.ClientSideEvents.Init = "function(s, e) {s.InsertItem('" + GeneralConstants.FilterAll.Key + "', '" + GeneralConstants.FilterAll.Value + "', '');}"; } }
protected virtual void OnEditorInitialize_BaseImplementation(ASPxGridViewEditorEventArgs e) { if (ReadOnly) { e.Editor.ReadOnly(true); } }
internal void RaiseEditorInitialize_Internal(ASPxGridViewEditorEventArgs e) { RaiseEditorInitialize(e); }
/// <summary> /// bloque los datos que no son editables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ASPxGridViewHistorialMatricula_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) { if (e.Column.FieldName == "estado") { e.Editor.ReadOnly = false; e.Column.ReadOnly = false; e.Editor.BackColor = System.Drawing.Color.White; } if (e.Column.FieldName == "estudianteNombre") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "periodo") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "carrera") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "grado") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "idMatricula") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "pagoContado") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "ordinaria") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaCreacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "usuarioModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } if (e.Column.FieldName == "fechaModificacion") { e.Editor.ReadOnly = true; e.Column.ReadOnly = true; e.Editor.BackColor = System.Drawing.Color.LightGray; } }