private void ugBTS_BeforeCellListDropDown(object sender, CancelableCellEventArgs e) { UltraDropDown udd = e.Cell.ValueListResolved as UltraDropDown; if (udd != null) { udd.DropDownWidth = e.Cell.Column.CellSizeResolved.Width; } }
private void gridtest_BeforeCellActivate(object sender, CancelableCellEventArgs e) { if (e.Cell.Column.ToString() == "F1") { if (fncValidateDouble(gridtest.ActiveRow.Cells["CR"].Value.ToString()) > 0) { F1 = gridtest.ActiveRow.Cells["F1"].Text; } } }
private void dgvDatos_BeforeCellActivate(object sender, CancelableCellEventArgs e) { if (dgvDatos.DisplayLayout.Bands[0].Columns["Descuento"].Index == e.Cell.Column.Index) { if ((dgvDatos.ActiveRow.Cells["PF2"].Value == DBNull.Value ? decimal.Zero : Convert.ToDecimal(dgvDatos.ActiveRow.Cells["PF2"].Value)) != decimal.Zero) { MessageBox.Show("No se puede modificar factor, elimine el precio primero."); e.Cancel = true; } } if (dgvDatos.DisplayLayout.Bands[0].Columns["PF2"].Index == e.Cell.Column.Index) { if ((dgvDatos.ActiveRow.Cells["Descuento"].Value == DBNull.Value ? decimal.Zero : Convert.ToDecimal(dgvDatos.ActiveRow.Cells["Descuento"].Value)) != decimal.Zero) { MessageBox.Show("No se puede modificar precio, elimine el factor primero."); e.Cancel = true; } } }
/// <summary>Behandelt das BeforeCellActivate Ereignis des ultraGridErnaehrung Controls.</summary> /// <param name="sender">Die Quelle des Ereignisses.</param> /// <param name="e">Die <see cref="RowEventArgs"/> Instanz, welche die Ereignisdaten enthält.</param> private void OnUltraGridErnaehrungBeforeCellActivate(object sender, CancelableCellEventArgs e) { }
private void listaMovimentiBeforeCellActivate(object sender, CancelableCellEventArgs e) { if (e.Cell.Row.IsDataRow && e.Cell.Column.Key == "SelectColumn") { if (e.Cell.Row.Cells["StatoMovimento"].Value.ToString() != Sfera.Enums.StatoMovimentoBancarioEnum.DaContabilizzare.ToString()) e.Cancel = true; } }
private void listaContiPatrimonialiBeforeCellActivate(object sender, CancelableCellEventArgs e) { if (e.Cell.Row.Band.Key == "SottoConti") { if (e.Cell.Column.Key == "Codice" && e.Cell.Value == null) { var contoRiferimento = (ContoDTO)e.Cell.Row.ParentRow.ListObject; e.Cell.Value = contoRiferimento.Codice + "."; } } }
private void listaBeforeCellActivate(object sender, CancelableCellEventArgs e) { if (e.Cell.Row.ListObject is DisposizionePagamentoDTO) { if (!(bool)e.Cell.Row.Cells["Selezionabile"].Value) e.Cancel = true; else e.Cancel = false; } }
void ug_list_BeforeCellListDropDown(object sender, CancelableCellEventArgs e) { UltraGrid ug_list = sender as UltraGrid; if (ug_list.DisplayLayout.Override.CellClickAction == CellClickAction.CellSelect || ug_list.DisplayLayout.Override.CellClickAction == CellClickAction.RowSelect) { e.Cancel = true; return; } UltraGridCell cell = ug_list.ActiveCell; if (cell == null) { return; } Sys_PD_Filed field = cell.Column.Tag as Sys_PD_Filed; if (field.DCP_ControlType == "ref") { UltraDropDown drop = cell.Column.ValueList as UltraDropDown; drop.Rows.ColumnFilters[field.DCP_RefValue].FilterConditions.Clear(); drop.Rows.ColumnFilters[field.DCP_RefValue].FilterConditions.Add(FilterComparisionOperator.Contains, cell.Text); if (!string.IsNullOrEmpty(field.DCP_PControl)) { // 0 父级控件ID 1 过滤数据参考列 string[] pControl = field.DCP_PControl.Split(','); if (pControl.Length <= 2) { drop.Rows.ColumnFilters[pControl[1]].FilterConditions.Clear(); if (cell.Row.Cells[pControl[0]].Value != null) { drop.Rows.ColumnFilters[pControl[1]].FilterConditions.Add(FilterComparisionOperator.Contains, cell.Row.Cells[pControl[0]].Value.ToString()); } else { drop.Rows.ColumnFilters[pControl[1]].FilterConditions.Add(FilterComparisionOperator.Contains, ""); } } //如果有三个参数则表示 取反 else { drop.Rows.ColumnFilters[pControl[1]].FilterConditions.Clear(); if (cell.Row.Cells[pControl[0]].Value != null) { drop.Rows.ColumnFilters[pControl[1]].FilterConditions.Add(FilterComparisionOperator.DoesNotContain, cell.Row.Cells[pControl[0]].Value.ToString()); } else { drop.Rows.ColumnFilters[pControl[1]].FilterConditions.Add(FilterComparisionOperator.Contains, ""); } } } } }
private void listaMovimentiBeforeCellActivate(object sender, CancelableCellEventArgs e) { if (e.Cell.Row.IsDataRow && e.Cell.Column.Key == "SelectColumn") { if (e.Cell.Row.Cells["StatoMovimento"].Value.ToString() != "DACONTABIL") e.Cancel = true; } else if (e.Cell.Row.IsDataRow && e.Cell.Column.Key == "Esercizio") { if (e.Cell.ValueList == null) { if (e.Cell.Row.Cells["Condominio"].Value != null) { var esercizi = _listaEsercizi.ContainsKey(((CondominioDTO)e.Cell.Row.Cells["Condominio"].Value).Codice) ? _listaEsercizi[((CondominioDTO)e.Cell.Row.Cells["Condominio"].Value).Codice] : getEsercizioService().GetByCondominio((CondominioDTO)e.Cell.Row.Cells["Condominio"].Value); string listUniqueKey = "Esercizio_" + e.Cell.Row.Cells["DescrizioneCondominio"].Value; if (listaMovimenti.DisplayLayout.ValueLists.Exists(listUniqueKey)) listaMovimenti.DisplayLayout.ValueLists.Remove(listUniqueKey); var valueList = DataSourceHelper.GetValueList(esercizi, "Esercizi"); valueList.Key = listUniqueKey; listaMovimenti.DisplayLayout.ValueLists.Add(valueList); e.Cell.ValueList = listaMovimenti.DisplayLayout.ValueLists[listUniqueKey]; } } } }
/// <summary> /// Handles the BeforeCellListDropDown event of the DepreciationControlDataGrid control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Infragistics.Win.UltraWinGrid.CancelableCellEventArgs"/> instance containing the event data.</param> private void DepreciationControlDataGrid_BeforeCellListDropDown(object sender, CancelableCellEventArgs e) { ////here columns are resizeble then drop down width is also adjusted if (this.DepreciationControlDataGrid.DisplayLayout.Bands[0].Columns[e.Cell.Column.Index].Width > 90) { this.DeprGridDropDown.DisplayLayout.Bands[0].Columns[this.listDeprDataTable.TextColumn.ColumnName].Width = this.DepreciationControlDataGrid.DisplayLayout.Bands[0].Columns[e.Cell.Column.Index].Width + 30; this.DeprGridDropDown.Width = this.DepreciationControlDataGrid.DisplayLayout.Bands[0].Columns[e.Cell.Column.Index].Width + 30; /*Added By Ramya for BugId 1969 */ if (this.listDeprDataTable.Rows.Count > 1) { this.DeprGridDropDown.DisplayLayout.Scrollbars = Scrollbars.Both; } else { this.DeprGridDropDown.DisplayLayout.Scrollbars = Scrollbars.None; } /*Till here*/ } else { this.DeprGridDropDown.DisplayLayout.Bands[0].Columns[this.listDeprDataTable.TextColumn.ColumnName].Width = 140; this.DeprGridDropDown.Width = 140; } }
private void lista_BeforeCellActivate(object sender, CancelableCellEventArgs e) { if (e.Cell.Column.Key == "IdSottoConto") { // Before a cell in the SottoConto column is activated, change the filter on the // DropDown to only display SottoConti in the selected Conto. var rootBand = sottoContoDropDown.DisplayLayout.Bands[0]; rootBand.ColumnFilters.ClearAllFilters(); rootBand.ColumnFilters["IdContoRiferimento"].FilterConditions.Add(FilterComparisionOperator.Equals, e.Cell.Row.Cells["IdConto"].Value); } }