private void auditGridView_InitializeRow(object sender, InitializeRowEventArgs e) { // Get the application object being displayed object dataObject = e.Row.Cells["DataObject"].Value; if (dataObject is Asset) { Asset asset = e.Row.Cells["DataObject"].Value as Asset; Bitmap icon = asset.DisplayIcon(); e.Row.Cells[1].Appearance.Image = icon; } else if (dataObject is FileSystemFolder) { e.Row.Cells[1].Appearance.Image = Properties.Resources.folder_16; } else if (dataObject is FileSystemFile) { e.Row.Cells[1].Appearance.Image = Properties.Resources.file_16; } else { UltraTreeNode treeNode = e.Row.Cells["DataObject"].Value as UltraTreeNode; // Set the image for the first cell to be the same as that in the tree node //e.Row.Cells[1].Appearance.Image = treeNode.LeftImages[0]; } }
/// <summary> /// 加入新行时的初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ulGrid_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Index == GroupBandIdx) { e.Row.ExpandAll(); e.Row.Appearance.BackColor = Color.DarkGray; } else if (e.Row.Band.Index == PropBandIdx) { e.Row.ExpandAll(); string strType = e.Row.Cells[fieldType].Text; e.Row.Cells[fieldValue].Editor = this.GetEmbeddableEditor( strType, e.Row.Cells[fieldTag].Value); if (strType == "Enum" || strType == "CustomEnum" || strType == "Color" || strType == "Font" || strType == "YesNoDropDown") { e.Row.Cells[1].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; } } else if (e.Row.Band.Index == SubOptBandIdx) { e.Row.Cells["PropOptVal"].Editor = this.GetEmbeddableEditor("YesNoCheckBox", null); e.Row.Cells["PropOptVal"].Editor.ValueChanged += new EventHandler(Editor_ValueChanged); e.Row.Cells["PropOptVal"].Editor.Tag = e.Row; } }
private void dgvDatos_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Index == 0) { e.Row.Cells["GenerarFolio"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; e.Row.Cells["GenerarFolio"].Value = "Generar"; e.Row.Cells["AutorizarFolio"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; e.Row.Cells["AutorizarFolio"].Value = "Autorizar"; e.Row.Cells["CancelarFolio"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; e.Row.Cells["CancelarFolio"].Value = "Cancelar"; string FolioReal = e.Row.Cells["FolioReal"].Value.ToString(); string Estatus = e.Row.Cells["Estatus"].Value.ToString(); if ((FolioReal != "") || Estatus == "PENDIENTE") { e.Row.Cells["GenerarFolio"].Activation = Activation.Disabled; } else if (FolioReal == "" && Estatus == "AUTORIZADA") { e.Row.Cells["GenerarFolio"].Activation = Activation.AllowEdit; } else if (Estatus == "NO APROBADA") { e.Row.Cells["GenerarFolio"].Activation = Activation.Disabled; } if (Estatus != "PENDIENTE") { e.Row.Cells["AutorizarFolio"].Activation = Activation.Disabled; e.Row.Cells["CancelarFolio"].Activation = Activation.Disabled; } } }
/// <summary> /// Handles the InitializeRow event of the SearchResultGrid control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:Infragistics.Win.UltraWinGrid.InitializeRowEventArgs"/> instance containing the event data.</param> private void SearchResultGrid_InitializeRow(object sender, InitializeRowEventArgs e) { try { long temp; if (this.SearchResultGrid.Rows.Count > 0) { temp = Convert.ToInt64(this.SearchResultGrid.Rows[e.Row.Index].Cells[this.searchData.GroupIDColumn.ColumnName].Value.ToString()); // set back color that we might want to show in the Group Column if (temp % 2 == 0) { this.SearchResultGrid.Rows[e.Row.Index].Cells[this.searchData.GroupColumn.ColumnName].Appearance.BackColor = Color.FromArgb(206, 219, 239); } else { this.SearchResultGrid.Rows[e.Row.Index].Cells[this.searchData.GroupColumn.ColumnName].Appearance.BackColor = Color.FromArgb(206, 223, 173); } } } catch (SoapException ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); } catch (Exception ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); } }
void uGridMaster_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["ina03"].Value.ToString() == "2") { e.Row.Cells["ina10"].Appearance.ForeColor = Color.Red; } }
private void ultraGridHead_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["opCode"].Value.ToString().Equals(_NextOP.Trim().ToUpper())) { e.Row.Appearance.BackColor = Color.Red; } }
private void OnInitializeRow(object sender, InitializeRowEventArgs e) { //Event handler for row intialize event try { //Bold rows of new issues/actions int id = Convert.ToInt32(e.Row.Cells["ID"].Value); DateTime dt1 = Convert.ToDateTime(e.Row.Cells["LastActionCreated"].Value); if (!this.mOldItems.ContainsKey(id)) { //Not viewed or startup (i.e. collection is empty) if (dt1.CompareTo(this.mLastNewIssueTime) > 0) { e.Row.CellAppearance.FontData.Bold = DefaultableBoolean.True; } } else { DateTime dt2 = Convert.ToDateTime(this.mOldItems[id]); if (dt1.CompareTo(dt2) > 0) { //LastActionCreated is different then last time viewed e.Row.CellAppearance.FontData.Bold = DefaultableBoolean.True; } } } catch { } }
void listaRitenute_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Key == "RitenutaAccontoDTO") { e.Row.Cells["SelectColumn"].Value = e.Row.GetCellValue("Selezionabile"); } }
/// <summary> /// Called as each row in the grid is initialized - we use this to set the appearance of the row /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void applicationsGridView_InitializeRow(object sender, InitializeRowEventArgs e) { // Get the application object being displayed UltraGridRow thisRow = e.Row; UltraGridCell objectCell = thisRow.Cells[0]; InstalledApplication thisApplication = objectCell.Value as InstalledApplication; // Set the appearance and icon based on the compliancy status if (thisApplication.IsIgnored) { thisRow.Appearance = _ignoredAppearance; } else if (thisApplication.Licenses.Count == 0) { thisRow.Appearance = _notSpecifiedAppearance; } else if (thisApplication.IsCompliant()) { thisRow.Appearance = _compliantAppearance; } else { thisRow.Appearance = _noncompliantAppearance; } // Set the 'application' image to either be a NotIgnore or non-NotIgnore application //UltraGridCell applicationCell = thisRow.Cells["Application Name"]; //if (thisApplication.IsIgnored) // applicationCell.Appearance.Image = Properties.Resources.application_hidden_16; //else // applicationCell.Appearance.Image = Properties.Resources.application_16; }
/// <summary> /// 每行触发 /// </summary> private void ultraGridHead_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.HasParent() && (decimal.Parse(e.Row.Cells["SHORTQTY"].Value.ToString()) < 0)) { e.Row.Appearance.BackColor = Color.Red; } }
private void ultraGridMain_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["DelFlag"].Value.ToString() == "Y") { e.Row.Cells["DelFlag"].Row.Appearance.BackColor = Color.Yellow; } }
/// <summary> /// Called as each row in the grid is initialized - we use this to set the appearance of the row /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void computerGridView_InitializeRow(object sender, InitializeRowEventArgs e) { // Get the application object being displayed UltraGridRow thisRow = e.Row; ApplicationInstance thisInstance = thisRow.Cells[0].Value as ApplicationInstance; // If we have a Publisher then set its icon if (thisRow.Cells.Exists("Publisher")) { thisRow.Cells["Publisher"].Appearance.Image = Properties.Resources.application_publisher_16; } // If we have an Asset then set its icon if (thisRow.Cells.Exists("Asset")) { Asset asset = thisRow.Cells["ApplicationObject"].Value as Asset; thisRow.Cells["Asset"].Appearance.Image = asset.DisplayIcon(); } // If we can find an application cell then set its image also if (thisRow.Cells.Exists("Name")) { if (thisInstance != null) { thisRow.Cells["Name"].Appearance.Image = (thisInstance.IsIgnored) ? Properties.Resources.application_hidden_16 : Properties.Resources.application_16; } else { thisRow.Cells["Name"].Appearance.Image = Properties.Resources.application_16; } } }
private void dgvDatos_InitializeRow(object sender, InitializeRowEventArgs e) { if (Convert.ToDecimal(e.Row.Cells["I"].Value == DBNull.Value ? decimal.Zero : e.Row.Cells["I"].Value) <= 4) { e.Row.Cells[0].Appearance.BackColor = Color.Red; e.Row.Cells[0].Appearance.ForeColor = Color.White; } }
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells.Exists("Section") && (e.Row.Cells["Section"].Value.ToString() == "Sub Type Catalogs" || e.Row.Cells["Section"].Value.ToString() == "Tracker Infos")) { e.Row.Expanded = true; } }
private void UltraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (Strings.Len(e.Row.Cells["KONTO"].Value.ToString()) == 1) { e.Row.Appearance.ForeColor = Color.Green; e.Row.Appearance.FontData.Bold = DefaultableBoolean.True; } }
private void saldiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Key == "SaldiBancari") { if ((decimal)e.Row.Cells["SaldoBanca"].Value < 0) e.Row.Appearance.BackColor = Color.Red; } }
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (DateTime.Now.TimeOfDay.TotalMinutes >= GlobalVar.globalParameter.resultTime) { double equivalentNum = Convert.ToDouble(e.Row.Cells["EquivalentNum"].Value); double result = e.Row.Cells["Result"].Value == DBNull.Value ? 0 : Convert.ToDouble(e.Row.Cells["Result"].Value); if (result + 0.00001 >= equivalentNum) { e.Row.Cells["WarrantName"].Appearance.BackColor = Color.PaleGreen; } } string warrantID = e.Row.Cells["WarrantID"].Value.ToString(); string underlyingID = e.Row.Cells["UnderlyingID"].Value.ToString(); string issuable = "NA"; string reissuable = "NA"; string toolTip1 = "今日未達增額標準"; string toolTip2 = "非本季標的"; string toolTip3 = "標的發行檢查=N"; string sqlTemp = "SELECT IsNull(Issuable,'NA') Issuable FROM [EDIS].[dbo].[WarrantUnderlyingSummary] WHERE UnderlyingID = '" + underlyingID + "'"; //DataView dvTemp = DeriLib.Util.ExecSqlQry(sqlTemp, GlobalVar.loginSet.edisSqlConnString); DataTable dtTemp = MSSQL.ExecSqlQry(sqlTemp, GlobalVar.loginSet.edisSqlConnString); if (dtTemp.Rows.Count > 0) { issuable = dtTemp.Rows[0]["Issuable"].ToString(); } string sqlTemp2 = "SELECT IsNull([ReIssuable],'NA') ReIssuable FROM [EDIS].[dbo].[WarrantReIssuable] WHERE WarrantID = '" + warrantID + "'"; //DataView dvTemp2 = DeriLib.Util.ExecSqlQry(sqlTemp2, GlobalVar.loginSet.edisSqlConnString); dtTemp = MSSQL.ExecSqlQry(sqlTemp2, GlobalVar.loginSet.edisSqlConnString); if (dtTemp.Rows.Count > 0) { reissuable = dtTemp.Rows[0]["ReIssuable"].ToString(); } if (issuable == "NA") { e.Row.ToolTipText = toolTip2; e.Row.Appearance.ForeColor = Color.Red; } else if (issuable == "N") { e.Row.Cells["UnderlyingID"].ToolTipText = toolTip3; e.Row.Cells["UnderlyingID"].Appearance.ForeColor = Color.Red; } if (reissuable == "NA") { e.Row.Cells["WarrantID"].ToolTipText = toolTip1; e.Row.Cells["WarrantID"].Appearance.ForeColor = Color.Red; } }
private void grdRegionOption_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells.Exists("Delete")) { string path = "image\\delete2.ico"; Image image = Bitmap.FromFile(path); e.Row.Cells["Delete"].Value = image; } }
protected override void OnInitializeRow(InitializeRowEventArgs e) { base.OnInitializeRow(e); foreach (UltraGridColumn columns in e.Row.Band.Columns) { columns.Nullable = Infragistics.Win.UltraWinGrid.Nullable.Nothing; } }
private void grdData_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["i_IsDeleted"].Value.ToString() == "1") { e.Row.Appearance.BackColor = Color.Red; e.Row.Appearance.BackColor2 = Color.White; //Y doy el efecto degradado vertical e.Row.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump; } }
private void grdData_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Index % 2 == 0) { e.Row.Appearance.BackColor = Color.FromKnownColor(KnownColor.ControlLight); } else { e.Row.Appearance.BackColor = Color.FromKnownColor(KnownColor.ControlLightLight); } }
private void OnGridInitializeRow(object sender, InitializeRowEventArgs e) { //Event handler for intialize row event try { if (e.Row.Cells["ApprovalDate"].Value == DBNull.Value && e.Row.Cells["DenialDate"].Value == DBNull.Value) { e.Row.Appearance.BackColor = Color.Yellow; } } catch (Exception ex) { App.ReportError(ex, false, LogLevel.Information); } }
private void grdData_InitializeRow(object sender, InitializeRowEventArgs e) { foreach (UltraGridRow rowSelected in this.grdData.Rows) { var banda = e.Row.Band.Index.ToString(); if (banda == "0") { if (rowSelected.Band.Index.ToString() == "0") { if (e.Row.Cells["d_FechaAlta"].Value != null) { e.Row.Appearance.BackColor = Color.Yellow; e.Row.Appearance.BackColor2 = Color.White; btnTicket.Enabled = false; btnEditarTicket.Enabled = false; btnEliminarTicket.Enabled = false; btnImprimirTicket.Enabled = false; btnAgregarExamenes.Enabled = false; btnAsignarHabitacion.Enabled = false; btnEditarHabitacion.Enabled = false; btnEliminarHabitacion.Enabled = false; btnDarAlta.Enabled = false; //Y doy el efecto degradado vertical e.Row.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump; //grdData.DisplayLayout.Bands[1].Override.SelectTypeGroupByRow = SelectType.None; //e.Row.Band.Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay; //e.Row.Band.Override.SelectTypeGroupByRow = SelectType.None; //rowSelected.IsActiveRow = false; //grdData.Selected.Rows[0].Band.Override.SelectTypeRow = SelectType.None; } } } if (banda == "2") { if (rowSelected.Band.Index.ToString() == "0") { if (e.Row.Cells["TicketInterno"].Value == "SI") { e.Row.Appearance.BackColor = Color.LightGreen; e.Row.Appearance.BackColor2 = Color.White; //Y doy el efecto degradado vertical e.Row.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump; } } } } }
private void grdDataServiceComponent_InitializeRow(object sender, InitializeRowEventArgs e) { //Si el contenido de la columna Vip es igual a SI if (e.Row.Cells["i_ServiceComponentStatusId"].Value.ToString() == ((int)Common.ServiceComponentStatus.Culminado).ToString()) { //Escojo 2 colores e.Row.Appearance.BackColor = Color.White; e.Row.Appearance.BackColor2 = Color.Cyan; //Y doy el efecto degradado vertical e.Row.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump; } }
private void ugdData_InitializeRow(object sender, InitializeRowEventArgs e) { // Expand rows in band 0 //if (e.Row.Band.Index == 0) // e.Row.ExpandAll(); if (e.Row.Band.Index == 0 && e.Row.Cells["Vrsta"].Value.ToString() == "SU") { e.Row.Appearance.BackColor = Color.Red; e.Row.Appearance.BackColor2 = Color.Red; } }
private void OnScheduleInitializeRow(object sender, InitializeRowEventArgs e) { //Event handler for intialize row event try { if (e.Row.Cells["Cancelled"].Value.ToString().Trim().Length > 0) { e.Row.Appearance.ForeColor = System.Drawing.Color.DarkGray; e.Row.Activation = Activation.NoEdit; } } catch (Exception ex) { App.ReportError(ex, false, LogLevel.Information); } }
private void dgvAlmacenes_InitializeRow(object sender, InitializeRowEventArgs e) { try { if (e.Row.Cells["Almacen"].Value.ToString().Equals("TOTAL")) { e.Row.Appearance.FontData.Bold = DefaultableBoolean.True; } } catch (Exception) { } }
private void grdDataService_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["i_StatusLiquidation"].Value == null) { return; } if ((int)e.Row.Cells["i_StatusLiquidation"].Value == (int)PreLiquidationStatus.Generada) { e.Row.Cells["Liq"].Value = Resources.accept; e.Row.Cells["Liq"].ToolTipText = "Generada"; } }
private void ultraGridScrutiny_InitializeRow(object sender, InitializeRowEventArgs e) { if (Convert.ToDouble(e.Row.Cells[9].Value.ToString()) <= int.Parse(this.ucLToMaintainDate.Value.Trim()) && Convert.ToDouble(e.Row.Cells[9].Value.ToString()) > 0) { e.Row.Appearance.BackColor = Color.Yellow; } else if (Convert.ToDouble(e.Row.Cells[9].Value.ToString()) <= 0) { e.Row.Appearance.BackColor = Color.Red; } }
private void ugvDatos_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Index == 0) { e.Row.Cells["Procesar"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; e.Row.Cells["Procesar"].Value = "Procesar/Guardar"; e.Row.Cells["Autorizar"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; e.Row.Cells["Autorizar"].Value = "Autorizar"; e.Row.Cells["Cancelar"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; e.Row.Cells["Cancelar"].Value = "Cancelar"; } }
private void grdWorkers_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["d_InsertDate"].Value == null) { return; } if (DateTime.Parse(e.Row.Cells["d_InsertDate"].Value.ToString()).Date != DateTime.Today.Date) { return; } e.Row.Appearance.BackColor = Color.White; e.Row.Appearance.BackColor2 = Color.Yellow; e.Row.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump; }
/// <summary> /// Handles the InitializeRow of the grid. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void grdCashflowSources_InitializeRow(object sender, InitializeRowEventArgs e) { // If there's no current month data, yet, just bail out. if (null == this.currentMonthData) { return; } // Each row in the grid is an Activity. Get the Activity for the row. Showcase.CashflowDashboard.Data.Activity activity = (Showcase.CashflowDashboard.Data.Activity)e.Row.ListObject; // Get the values we need to fill up the unbound columns in the grid. // This is done with a call to an absract method so that the InflowDetails and // Outflow Details can return the appropriate values. // decimal value; decimal projected; decimal?lastMonth = null; decimal?lastYear = null; Image legend; this.GetGridRowValues(activity, ref lastMonth, ref lastYear, out value, out projected, out legend); // Populate the grid cells with the calculated values. // e.Row.Cells["projected"].Value = Utilities.GetComparisonString(value, projected); if (null != lastMonth) { e.Row.Cells["last month"].Value = Utilities.GetComparisonString(value, lastMonth.Value); } else { e.Row.Cells["last month"].Value = Utilities.LocalizeString("CashflowDetails_Category_Label_noPreviousData"); } if (null != lastYear) { e.Row.Cells["last year"].Value = Utilities.GetComparisonString(value, lastYear.Value); } else { e.Row.Cells["last year"].Value = Utilities.LocalizeString("CashflowDetails_Category_Label_noPreviousData"); } e.Row.Cells["label"].Value = legend; }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.ListObject != null && e.Row.ListObject is FascicoloImmobiliareDTO) { var fascicolo = (FascicoloImmobiliareDTO)e.Row.ListObject; if (fascicolo.Stato == "D") e.Row.Appearance.ForeColor = Color.LightGray; if(!fascicolo.IsDeleteAllow && fascicolo.ID > 0 && !e.Row.IsAddRow) { e.Row.Cells["Descrizione"].Activation = Activation.ActivateOnly; e.Row.Cells["DescrizioneBreve"].Activation = Activation.ActivateOnly; e.Row.Cells["Codice"].Activation = Activation.ActivateOnly; e.Row.Cells["IsRequiredFornitore"].Activation = Activation.ActivateOnly; e.Row.Cells["IsRequiredData"].Activation = Activation.ActivateOnly; } } }
private void lista_InitializeRow(object sender, InitializeRowEventArgs e) { try { if (e.Row.Band.Columns.Exists("Hidden") && e.Row.GetCellValue("Hidden") != null && ((bool)e.Row.GetCellValue("Hidden"))) e.Row.Appearance.ForeColor = Color.LightGray; if (e.Row.Cells.Exists("IdConto") && e.Row.Cells.Exists("Conto") && e.Row.GetCellValue("IdConto") != null) e.Row.Cells["Conto"].Activation = Activation.NoEdit; if (e.Row.Cells.Exists("OrdineConto") && e.Row.GetCellValue("OrdineConto") != null && (int)e.Row.GetCellValue("OrdineConto") > 0) e.Row.Cells["OrdineConto"].Activation = Activation.NoEdit; } catch (Exception ex) { _log.ErrorFormat("Errore inaspettato durante l'inizializzazione della riga - {0} - azienda:{1}", ex, Gipasoft.Library.Utility.GetMethodDescription(), Security.Login.Instance.CurrentLogin().Azienda); throw; } }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { try { var nota = e.Row.ListObject as NotaAccreditoRiscossioneDTO; if (nota != null) { var listUniqueKey = "Riscossioni_" + nota.IdSpesa; if (!lista.DisplayLayout.ValueLists.Exists(listUniqueKey)) { var valueList = DataSourceHelper.GetValueList(_contiPagamentiFornitori.Where(item => item.IdCondominio == nota.IdCondominio), "ID", "Descrizione", listUniqueKey); valueList.Key = listUniqueKey; lista.DisplayLayout.ValueLists.Add(valueList); } e.Row.Cells["IdConto"].ValueList = lista.DisplayLayout.ValueLists[listUniqueKey]; setSottoContoValueList(e.Row); } } catch (Exception ex) { _log.ErrorFormat("Errore nella inizializzazione di una riga - {0} - azienda:{1}", ex, Gipasoft.Library.Utility.GetMethodDescription(), Security.Login.Instance.CurrentLogin().Azienda); throw; } }
private void listaMovimentiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row != null && e.Row.IsDataRow) { try { if (e.Row.Cells.Exists("Segno") && e.Row.Cells.Exists("Importo") && e.Row.Cells["Segno"].Value != null && e.Row.Cells["Segno"].Value.ToString() == "D" && e.Row.Cells["Importo"].Value != null && (decimal)e.Row.Cells["Importo"].Value > 0) e.Row.Cells["Importo"].Value = (decimal)e.Row.Cells["Importo"].Value * -1; if (e.Row.Cells.Exists("StatoMovimento") && e.Row.Cells.Exists("Selezionabile") && e.Row.Cells.Exists("SelectColumn") && e.Row.Cells["StatoMovimento"].Value.ToString() == Sfera.Enums.StatoMovimentoBancarioEnum.Errato.ToString()) { e.Row.Appearance.ForeColor = Color.DarkRed; e.Row.Cells["Selezionabile"].Value = false; e.Row.Cells["SelectColumn"].Activation = Activation.Disabled; } else if (e.Row.Cells.Exists("StatoMovimento") && e.Row.Cells["StatoMovimento"].Value != null && e.Row.Cells.Exists("Selezionabile") && e.Row.Cells["StatoMovimento"].Value.ToString() == Sfera.Enums.StatoMovimentoBancarioEnum.DaContabilizzare.ToString()) { e.Row.Appearance.ForeColor = Color.DarkGreen; e.Row.Cells["Selezionabile"].Value = true; } else if (e.Row.Cells.Exists("StatoMovimento") && e.Row.Cells.Exists("OpenMovimentoForm") && e.Row.Cells["StatoMovimento"].Value != null && e.Row.Cells["StatoMovimento"].Value.ToString() == Sfera.Enums.StatoMovimentoBancarioEnum.Contabilizzato.ToString()) { e.Row.Cells["OpenMovimentoForm"].Hidden = true; e.Row.Cells["OpenMovimentoForm"].Activation = Activation.Disabled; } else if (e.Row.Cells.Exists("Selezionabile") && e.Row.Cells.Exists("SelectColumn")) { e.Row.Appearance.ForeColor = Color.Black; e.Row.Cells["SelectColumn"].Activation = Activation.Disabled; e.Row.Cells["Selezionabile"].Value = false; } listaMovimenti.UpdateData(); listaMovimenti.PerformAction(UltraGridAction.ExitEditMode); } catch (Exception ex) { _log.ErrorFormat("Errore nell'impostazione del layout - {0} - esercizio:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), _esercizio != null ? _esercizio.ID.ToString(CultureInfo.InvariantCulture) : "<NULL>", Security.Login.Instance.CurrentLogin().Azienda); throw; } } }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { var dto = e.Row.ListObject as DisposizionePagamentoDTO; if (dto != null) { if (!(bool)e.Row.Cells["Selezionabile"].Value) { e.Row.Cells["SelectColumn"].Value = false; e.Row.Appearance.ForeColor = Color.LightGray; e.Row.Activation = Activation.Disabled; } if (e.Row.Cells["ErroreNonSelezionabile"].Value != null) e.Row.Tag = new ToolTipCellInfo(string.Format("Autorizzazione Pagamento di {0} per {1}", ((decimal)e.Row.Cells["ImportoDaPagare"].Value).ToString("c"), e.Row.Cells["Fornitore"].Value), e.Row.Cells["ErroreNonSelezionabile"].Value.ToString()) { ImageType = "warn" }; if(e.Row.IsFilteredOut) e.Row.Cells["SelectColumn"].Value = false; } }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Index == 0 && e.Row.IsDataRow && e.Row.Band.Columns.Exists("ImportoPreventivo")) { var item = (CalcoloBilancioPreventivoDTO)e.Row.ListObject; var conto = getPianoContiService().GetById(item.IdConto, _esercizio.ID); if (conto.IsSpesePersonali) { e.Row.Cells["ImportoPreventivo"].Activation = Activation.NoEdit; if(item.DettaglioUnita != null) e.Row.Cells["ImportoPreventivo"].Value = item.DettaglioUnita.Sum(row => row.ImportoPreventivo); } } }
void ug_list_InitializeRow(object sender, InitializeRowEventArgs e) { UltraGrid ug_list = sender as UltraGrid; GridTagObject gridObj = ug_list.Tag as GridTagObject; string prefix = gridObj.GridValuePrefix; string _colType = prefix + "_Type"; string _dictKey = prefix + "_DictKey"; string _colValue = prefix + "_VCol"; if (ug_list.DisplayLayout.Bands[0].Columns.Exists(_colType) && ug_list.DisplayLayout.Bands[0].Columns.Exists(_dictKey) && ug_list.DisplayLayout.Bands[0].Columns.Exists(_colValue))/////包含三行的时候则调用 { string[] col = e.Row.Cells[_colValue].Value.ToString().Split(','); switch (e.Row.Cells[_colType].Value.ToString().ToLower()) { case "dec": e.Row.Cells[col[1]].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Double; e.Row.Cells[col[0]].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Double; break; case "check": e.Row.Cells[col[0]].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox; e.Row.Cells[col[1]].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox; break; case "oshow": e.Row.Appearance.BackColor = Color.Yellow; e.Row.Activation = Activation.NoEdit; break; case "cdict": ValueList valueList = new ValueList(); string[] dic = e.Row.Cells[_dictKey].Value.ToString().Split(','); foreach (var obj in dic) { valueList.ValueListItems.Add(obj, obj); } e.Row.Cells[col[0]].ValueList = valueList; e.Row.Cells[col[1]].ValueList = valueList; e.Row.Cells[col[1]].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; break; } //e.Row.Cells[_colValue].Editor = } }
private void listaVersamentiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Index == 0) { var versamento = e.Row.ListObject as VersamentoSoggettoDTO; if (versamento != null) { var idEsercizio = versamento.IdEsercizio; var idCondominio = versamento.IdCondominio; var listUniqueKey = "Conti_" + idEsercizio; if (listaVersamenti.DisplayLayout.ValueLists.Exists(listUniqueKey)) listaVersamenti.DisplayLayout.ValueLists.Remove(listUniqueKey); var conti = getContiPatrimoniali(idCondominio); if (e.Row.Cells.Exists("IdConto")) { var valueList = DataSourceHelper.GetValueList(conti, "ID", "Descrizione", listUniqueKey); valueList.Key = listUniqueKey; listaVersamenti.DisplayLayout.ValueLists.Add(valueList); e.Row.Cells["IdConto"].ValueList = listaVersamenti.DisplayLayout.ValueLists[listUniqueKey]; if (conti.Count == 1) e.Row.Cells["IdConto"].Value = conti[0].ID; } setSottoContoValueList(e.Row); if(versamento.TipoVersamentoDopoChiusura != null) e.Row.Activation = Activation.NoEdit; if (!string.IsNullOrEmpty(versamento.IsAllowUpdate)) { if (e.Row.Cells.Exists("DeleteColumn")) { e.Row.Cells["DeleteColumn"].Hidden = true; } } } } }
private void grdDetail_InitializeRow(object sender, InitializeRowEventArgs e) { if ((Convert.ToInt16(e.Row.Cells["categoryindex"].Value) % 2) == 0) { e.Row.Appearance.BackColor = Color.LightGreen; } else { e.Row.Appearance.BackColor = Color.White; } }
private void listaRateSoggettiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells.Exists("SelectColumn")) { e.Row.Cells["SelectColumn"].Value = (Sfera.Enums.StatoRataEnum)Enum.Parse(typeof(Sfera.Enums.StatoRataEnum), e.Row.Cells["StatoRata"].Value.ToString(), true) != Sfera.Enums.StatoRataEnum.Spedita; } if (e.Row.Cells.Exists("StatoRata")) { if (e.Row.Cells["StatoRata"].Value != null && e.Row.Cells["StatoRata"].Value.ToString().ToLower() == "undefinded") e.Row.Cells["StatoRata"].Hidden = true; } if (e.Row.IsDataRow && e.Row.Band.Index == 0) { var dettaglio = (DettaglioEmissioneRateDTO)e.Row.ListObject; if (dettaglio.Rate != null && dettaglio.Rate.Count > 0) e.Row.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True; } }
private void contiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.IsAddRow && e.Row.Band.Key == "ContoDTO") { e.Row.Cells["Ripartizione"].Value = true; } // ---------------------------------------------------------------- // I conti NON inseriti dall'operatore ma inseriti automaticamente dal sistema // NON possono essere eliminati // ---------------------------------------------------------------- if (e.Row.IsDataRow && e.Row.Cells.Exists("DeletedColumn") && !e.Row.IsAddRow && e.Row.Cells["ID"].Value != null && (int)e.Row.Cells["ID"].Value > 0) { var allow = true; if (e.Row.Band.Key == "ContoDTO") { var conto = (ContoDTO)e.Row.ListObject; allow = conto.IsDeleteAllow; } else if (e.Row.Band.Key == "SottoConti") { var sottoConto = (SottoContoDTO)e.Row.ListObject; allow = sottoConto.IsDeleteAllow; } if (!allow) { e.Row.Activation = Activation.ActivateOnly; e.Row.Cells["DeletedColumn"].Hidden = true; } } }
private void listaMovimentiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.IsDataRow && e.Row.Band.Index == 0) { var movimento = (MovimentoContabileListaDTO)e.Row.ListObject; if (movimento.Segno == "D") e.Row.Cells["ImportoDare"].Value = movimento.Importo; else e.Row.Cells["ImportoAvere"].Value = movimento.Importo; setSottoContoValueList(e.Row); } }
private void listaRateSoggettiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Columns.Exists("StatoRata") && e.Row.Cells["StatoRata"].Value != null && (Sfera.Enums.StatoRataEnum)e.Row.Cells["StatoRata"].Value == Sfera.Enums.StatoRataEnum.Undefined) e.Row.Cells["StatoRata"].Hidden = true; if (e.Row.Band.Index == 0 && e.Row.IsDataRow) { var riepilogo = (RiepilogoRataSoggettoDTO)e.Row.ListObject; e.Row.Cells["ImportoDaVersare"].Value = riepilogo.Importo - riepilogo.ImportoVersato; if (riepilogo.NonSollecitare > 0) { foreach (var cell in e.Row.Cells) cell.Tag = new ToolTipCellInfo(e.Row.Cells["Nominativo"].Value.ToString(), "Non sollecitabile per: <strong>" + e.Row.Cells["MotivoNonSollecitare"].Value + "</strong>") { ImageType = "info" }; riepilogo.SelectColumn = false; e.Row.Appearance.ForeColor = Color.Gray; if (e.Row.Cells.Exists("SelectColumn")) e.Row.Cells["SelectColumn"].Activation = Activation.ActivateOnly; } else { if (e.Row.Cells.Exists("NonSollecitare")) e.Row.Cells["NonSollecitare"].Hidden = true; } } }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { try { if (e.Row.IsDataRow && e.Row.Band.Columns.Exists("FileExtension")) { var bmp = DocumentiResources.undefined; if (e.Row.GetCellValue("FileExtension") != null) { switch (e.Row.GetCellValue("FileExtension").ToString()) { case ".doc": case ".docx": bmp = DocumentiResources.Word; break; case ".pdf": bmp = DocumentiResources.Pdf; break; case ".xls": bmp = DocumentiResources.Excel; break; case ".rtf": bmp = DocumentiResources.rtf; break; case ".ppt": bmp = DocumentiResources.PPT; break; case "Archiva": bmp = DocumentiResources.archiva.ToBitmap(); break; } } else { e.Row.Cells["FileExtension"].Value = "Archiva"; bmp = DocumentiResources.archiva.ToBitmap(); } e.Row.Cells["FileExtension"].Appearance.Image = bmp; } } catch (Exception ex) { _log.ErrorFormat("Errore nell'impostazione dell'icona per il documento - {0} - fileExtension:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), e.Row.GetCellValue("FileExtension") != null ? e.Row.GetCellValue("FileExtension").ToString() : "<NULL>", Login.Instance.CurrentLogin().Azienda); } }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { if(e.Row.ListObject is StoricoMessaggioDTO) { if (e.Row.Band.Columns.Exists("Testo")) { if (e.Row.Cells["Testo"].Value != null && Utility.IsHtml(e.Row.Cells["Testo"].Value.ToString()) && e.Row.Cells.Exists("TestoSemplice")) { e.Row.Cells["TestoSemplice"].Value = Conversione.HtmlToString(e.Row.Cells["Testo"].Value.ToString()); //e.Row.Cells["TestoSemplice"].Tag = new ToolTipCellInfo("Messaggio", e.Row.Cells["Testo"].Value.ToString()) { ImageType = "info" }; } else if (e.Row.Cells["Testo"].Value != null && Utility.IsRTF(e.Row.Cells["Testo"].Value.ToString()) && e.Row.Cells.Exists("TestoSemplice")) e.Row.Cells["TestoSemplice"].Value = Conversione.RtfToString(e.Row.Cells["Testo"].Value.ToString()); else if (e.Row.Cells["Testo"].Value != null) e.Row.Cells["TestoSemplice"].Value = e.Row.Cells["Testo"].Value.ToString(); } } }
private void handleInitRow(object sender, InitializeRowEventArgs e_) { colourRow(e_.Row); }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { rowLayout(e.Row); }
private void ripartizioneDettaglioInitializeRow(object sender, InitializeRowEventArgs e) { ripartizioneDettaglio.DisplayLayout.Bands[0].Columns["PercentualeProprieta"].Editor.DataFilter = new PercentageDataFilter(); }
private void listaVotanti_InitializeRow(object sender, InitializeRowEventArgs e) { if (checkAbilitatoAllaVotazione(e.Row)) { e.Row.Cells["favorevole"].Activation = Activation.AllowEdit; e.Row.Cells["contrario"].Activation = Activation.AllowEdit; e.Row.Cells["astenuto"].Activation = Activation.AllowEdit; e.Row.Appearance.ResetBackColor(); } else { if (chkNonVotanti.Checked) { //resetto i valori su undefined... e.Row.Cells["favorevole"].Value = false; e.Row.Cells["contrario"].Value = false; e.Row.Cells["astenuto"].Value = false; ((PersonaPresente)e.Row.ListObject).Risultato = Sfera.Enums.RisultatoVotazione.Undefined; e.Row.Cells["favorevole"].Activation = Activation.NoEdit; e.Row.Cells["contrario"].Activation = Activation.NoEdit; e.Row.Cells["astenuto"].Activation = Activation.NoEdit; e.Row.Appearance.BackColor = SystemColors.ControlLight; e.Row.Hidden = false; } else { e.Row.Hidden = true; } } }
private void listaSpeseInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.IsDataRow && e.Row.Band.Index == 0) { decimal importo = 0; if (e.Row.Cells.Exists("ImportoSoggettoEntrante") && e.Row.GetCellValue("ImportoSoggettoEntrante") != null) importo += (decimal)e.Row.GetCellValue("ImportoSoggettoEntrante"); if (e.Row.Cells.Exists("ImportoSoggettoUscente") && e.Row.GetCellValue("ImportoSoggettoUscente") != null) importo += (decimal)e.Row.GetCellValue("ImportoSoggettoUscente"); if (e.Row.Cells.Exists("ImportoTotale")) e.Row.Cells["ImportoTotale"].Value = importo; } }
private void listaContiInitializeRow(object sender, InitializeRowEventArgs e) { setSottoContoValueList(e.Row); }
private void listaRateInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.IsDataRow) { var rata = (RataSoggettoSubentroDTO)e.Row.ListObject; if (!rata.IsAllowRichiamo) { foreach (var cell in e.Row.Cells) cell.Activation = Activation.NoEdit; e.Row.Appearance.ForeColor = Color.LightGray; } } }
private void scadenzeInitializeRow(object sender, InitializeRowEventArgs e) { setRowLayout(e.Row); }
private void listaRiepilogoInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["Key"].Value != null && e.Row.Cells["Key"].Value != DBNull.Value) { e.Row.Cells["Key"].Activation = Activation.ActivateOnly; if (e.Row.Cells["Key"].Value.ToString() == "COMP") e.Row.Cells["Key"].Activation = Activation.AllowEdit; if (e.Row.Cells["Key"].Value.ToString() == "SPESE" || e.Row.Cells["Key"].Value.ToString() == "TOTALE") { foreach (var cell in e.Row.Cells) cell.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True; } } }
private void contiInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.IsAddRow && e.Row.Band.Key == "ContoDTO" && e.Row.Cells.Exists("Ripartizione")) e.Row.Cells["Ripartizione"].Value = true; // ---------------------------------------------------------------- // I conti NON inseriti dall'operatore ma inseriti automaticamente dal sistema // NON possono essere eliminati // ---------------------------------------------------------------- if (e.Row.IsDataRow && e.Row.Cells.Exists("DeletedColumn") && !e.Row.IsAddRow && e.Row.Cells.Exists("ID") && e.Row.Cells["ID"].Value != null && (int)e.Row.Cells["ID"].Value > 0) { var allow = true; if (e.Row.Band.Key == "ContoDTO") { var conto = (ContoDTO)e.Row.ListObject; if (!conto.CustomField) allow = false; if(conto.Deleted) e.Row.Appearance.ForeColor = Color.LightGray; } else if (e.Row.Band.Key == "SottoConti") { var sottoConto = (SottoContoDTO)e.Row.ListObject; allow = sottoConto.IsDeleteAllow; } if (!allow) { if (e.Row.Cells.Exists("DeletedColumn")) e.Row.Cells["DeletedColumn"].Hidden = true; if (e.Row.Cells.Exists("Codice")) e.Row.Cells["Codice"].Activation = Activation.Disabled; if(e.Row.Band.Columns.Exists("IdEsercizio")) e.Row.Cells["IdEsercizio"].Activation = Activation.Disabled; } } }
private void scadenzeInitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Key == "Scadenze") { if(e.Row.Cells["Importo"] != null) e.Row.Expanded = true; setSottoContoBancarioValueList(e.Row); } if (e.Row.Band.Key == "Pagamenti" && e.Row.Cells["Tipo"].Value != null && (TipoPagamentoFatturaEnum)e.Row.Cells["Tipo"].Value != TipoPagamentoFatturaEnum.Manuale) e.Row.Cells["Documento"].Hidden = true; if (btnAnnullaPagamento.Visible) { scadenze.DisplayLayout.Bands[0].Columns["IdContoPagamentoScadenza"].Hidden = false; scadenze.DisplayLayout.Bands[0].Columns["IdSottoContoPagamentoScadenza"].Hidden = false; scadenze.DisplayLayout.Bands[0].Columns["IdContoPagamentoScadenza"].Width = 100; scadenze.DisplayLayout.Bands[0].Columns["IdSottoContoPagamentoScadenza"].Width = 100; if (((decimal?)aliquotaRitenuta.Value).GetValueOrDefault() > 0) { scadenze.DisplayLayout.Bands[0].Columns["DataPagamentoRitenuta"].Hidden = false; scadenze.DisplayLayout.Bands[0].Columns["DataPagamentoRitenuta"].Width = 120; } } }
private void listaRateSoggettiInitializeRow1(object sender, InitializeRowEventArgs e) { try { if (e.Row.Band.Columns.Exists("StatoRata") && e.Row.Cells["StatoRata"].Value != null && (StatoRataEnum)e.Row.Cells["StatoRata"].Value == StatoRataEnum.Undefined) e.Row.Cells["StatoRata"].Hidden = true; else if (e.Row.Band.Columns.Exists("StatoRata") && e.Row.Cells["StatoRata"].Value != null && (StatoRataEnum)e.Row.Cells["StatoRata"].Value == StatoRataEnum.Richiamata) { e.Row.Cells["StatoRata"].Appearance.ForeColor = Color.Gray; e.Row.Activation = Activation.ActivateOnly; } } catch (Exception ex) { _log.WarnFormat("Errore inaspettato durante la inizializzazione della listaRateSoggetti - {0} - condominio:{1} - esercizio:{2}", ex, Utility.GetMethodDescription(), _condominio.ID, _esercizio.ID); } }
private void listaInitializeRow(object sender, InitializeRowEventArgs e) { var pagamentoDTO = e.Row.ListObject as DisposizionePagamentoDTO; if (pagamentoDTO != null) { e.Row.Cells["ImportoPagamento"].Value = null; if (!(bool)e.Row.Cells["Selezionabile"].Value) { e.Row.Cells["SelectColumn"].Value = false; e.Row.Appearance.ForeColor = Color.LightGray; if (e.Row.Cells["ErroreNonSelezionabile"].Value != null) e.Row.Tag = new ToolTipCellInfo($"Pagamento di {((decimal) e.Row.Cells["ImportoAutorizzato"].Value).ToString("c")} per {e.Row.Cells["Fornitore"].Value}", e.Row.Cells["ErroreNonSelezionabile"].Value.ToString()) { ImageType = "warn" }; foreach (var cell in e.Row.Cells) { if (cell.Column.Key != "DeleteColumn") cell.Activation = Activation.Disabled; } } if (e.Row.IsFilteredOut) e.Row.Cells["SelectColumn"].Value = false; } }