private void onRowCellStyle(object sender, RowCellStyleEventArgs e) { if (!ShouldUseColorForDisabledCell) return; if (e.Column == null) return; if (e.Column.OptionsColumn.AllowEdit) return; if (!e.Column.OptionsColumn.ReadOnly) return; //column is readonly AdjustAppearance(e, false); }
private void gdvGeneric_RowCellStyle(object sender, RowCellStyleEventArgs e) { var obej = (BETypeArticle)gdvGeneric.GetRow(e.RowHandle); if (obej.IND_MNTN == 3) { e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Strikeout); e.Appearance.BackColor = Color.LightGray; e.Appearance.ForeColor = Color.Gray; } }
private void gvVideo_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView view = sender as GridView; if (e.RowHandle == view.FocusedRowHandle) { e.Appearance.BackColor = Color.Green; e.Appearance.ForeColor = Color.White; } }
private void gvwView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { string tomau_row = gvwView1.GetRowCellDisplayText(e.RowHandle, "SEASON_NAME"); if (tomau_row.Contains("TOTAL")) { e.Appearance.BackColor = Color.FromArgb(188, 188, 188); e.Appearance.ForeColor = Color.Yellow; } }
void view_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (isColored) { if (e.RowHandle == RowHandle && e.Column == Column) { e.Appearance.Assign(FlashedCellsHelper.FlashedCellAppearance); } } }
public void DrawStatusColor(object sender, RowCellStyleEventArgs e, GridColumn colStatus, GridColumn colDisplayColor) { if (e.RowHandle < 0) { return; } if (e.Column == colDisplayColor) { } }
private void sub_gridview_RowCellStyle(object sender, RowCellStyleEventArgs e) { foreach (CellInfo cellInfo in mChangedCells) { if (e.RowHandle == cellInfo.Row && e.Column.AbsoluteIndex == cellInfo.Column) { e.Appearance.BackColor = Color.LightPink; } } }
private void grvPickingList_RowCellStyle(object sender, RowCellStyleEventArgs e) { bool isAdjust = false; BaseView baseView = sender as BaseView; ColumnView colView = (ColumnView)this.grdPickingList.MainView; int iCompare, iValue; try { if (e.RowHandle == colView.FocusedRowHandle) { switch (e.Column.FieldName) { case "PICKED_QTY": iCompare = Convert.ToInt32((colView.GetRowCellValue(e.RowHandle, "PICKED_QTY") as decimal?) ?? 0, NumberFormatInfo.CurrentInfo); iValue = Convert.ToInt32((colView.GetRowCellValue(e.RowHandle, "QTY") as decimal?) ?? 0, NumberFormatInfo.CurrentInfo); if (iCompare > 0 && iCompare != iValue) { isAdjust = true; } break; case "LOADED_QTY": iCompare = Convert.ToInt32((colView.GetRowCellValue(e.RowHandle, "LOADED_QTY") as decimal?) ?? 0, NumberFormatInfo.CurrentInfo); iValue = Convert.ToInt32((colView.GetRowCellValue(e.RowHandle, "PICKED_QTY") as decimal?) ?? 0, NumberFormatInfo.CurrentInfo); if (iValue > 0 && iValue != iCompare) { isAdjust = true; } break; default: break; } if (isAdjust) { //Apply the appearance of the SelectedRow e.Appearance.Assign(((GridView)baseView).PaintAppearance.SelectedRow); e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; //Just to illustrate how the code works. Remove the following lines to see the desired appearance. //e.Appearance.Options.UseForeColor = true; e.Appearance.ForeColor = Color.Red; e.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, FontStyle.Bold); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } }
private void gvMain_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView gv = sender as GridView; string Is_NewRow = gv.GetRowCellValue(e.RowHandle, gv.Columns["IS_NEWROW"]) == null ? "0" : gv.GetRowCellValue(e.RowHandle, gv.Columns["IS_NEWROW"]).ToString(); if (e.Column.FieldName == disableCol) { e.Appearance.BackColor = Is_NewRow == "1" ? Color.White : Color.Silver; } }
private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { var row = gridView1.GetRow(e.RowHandle); if (!(row is SummaryRecord summaryRecord)) { return; } e.Appearance.ForeColor = summaryRecord.Result == "Success" ? Color.Black : Color.Red; }
protected void detailView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView currentView = sender as GridView; e.Appearance.BackColor = Color.Beige; if (e.Column.FieldName == nameof(childModel.ProcessStatus)) { Enum.TryParse(currentView.GetRowCellValue(e.RowHandle, nameof(childModel.ProcessStatus)).ToString(), out ProcessStatusEnum processStatus); RenderCommonHelper.SetStatusColor(processStatus, e); } }
private void gvSendMan_RowCellStyle(object sender, RowCellStyleEventArgs e) { gvReceiveMan.Appearance.OddRow.BackColor = Color.White; // 设置奇数行颜色 // 默认也是白色 可以省略 gvReceiveMan.OptionsView.EnableAppearanceOddRow = true; // 使能 // 和和上面绑定 同时使用有效 gvReceiveMan.Appearance.EvenRow.BackColor = Color.FromArgb(255, 250, 205); // 设置偶数行颜色 gvReceiveMan.OptionsView.EnableAppearanceEvenRow = true; // 使能 // 和和上面绑定 同时使用有效 if (e.RowHandle == gvReceiveMan.FocusedRowHandle) { e.Appearance.Font = new Font("宋体", 9, FontStyle.Bold); } }
private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { if ((comboExists[countryShortNames[e.RowHandle]] as Dictionary <string, bool>).ContainsKey(e.Column.FieldName)) { e.Appearance.BackColor = Color.White; } else { e.Appearance.BackColor = Color.LightGray; } }
private void gridView12_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { //e.Appearance.BackColor = Color.OrangeRed; e.Appearance.BackColor = Color.GreenYellow; e.Appearance.BackColor2 = Color.SeaShell; } }
private void gridView发货计划明细_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (gridControl发货计划明细.DataSource != null && e.RowHandle > -1) { var list = gridControl发货计划明细.DataSource as V_ICSEOUTBILLENTRYMODEL[]; var row = list[gridView发货计划明细.GetDataSourceRowIndex(e.RowHandle)]; if (row.FGROUP_STATUS == 1) { e.Appearance.BackColor = Color.FromArgb(211, 211, 211); } } }
private void gvMain_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView gv = sender as GridView; string isNewRow = gv.GetRowCellValue(e.RowHandle, gv.Columns["Is_NewRow"]) == null ? "0" : gv.GetRowCellValue(e.RowHandle, gv.Columns["Is_NewRow"]).ToString(); //新增時顏色轉為白底 if (e.Column.FieldName == "PLS4_SID" || e.Column.FieldName == "PLS4_KIND_ID2") { e.Appearance.BackColor = isNewRow == "1" ? Color.White : Color.FromArgb(224, 224, 224); } }
private void FrmNewFields_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView view = sender as GridView; string table = view.GridControl.Name; List <string> destFlds = fields[table]; if (destFlds.Contains(e.CellValue)) { e.Appearance.ForeColor = Color.Green; e.Appearance.BackColor = Color.LightGray; } }
private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (e.Column.FieldName == "Labela") { Task task = (Task)gridView1.GetRow(e.RowHandle); if (e.RowHandle >= 0) { if (task.Label != null) { switch (task.id_label) { //case (1): { e.Appearance.ForeColor = Color.GreenYellow; /*e.Appearance.BackColor2 = Color.White;*/ return; } //case (2): { e.Appearance.ForeColor = Color.Blue; /*e.Appearance.BackColor2 = Color.White;*/ return; } //case (3): { e.Appearance.ForeColor = Color.Red; /*e.Appearance.BackColor2 = Color.White;*/ return; } default: { e.Appearance.ForeColor = Color.Gray; /* e.Appearance.BackColor2 = Color.White;*/ return; } } } else { e.Appearance.ForeColor = Color.Gray; //e.Appearance.BackColor2 = Color.White; } //e.Handled = true; } } if (e.Column.FieldName == "Prioritet.opis") { Task task = (Task)gridView1.GetRow(e.RowHandle); if (e.RowHandle >= 0) { if (task.Prioritet.opis != null) { switch (task.Prioritet.opis) { case ("Low"): { e.Appearance.ForeColor = Color.Green; /*e.Appearance.BackColor2 = Color.White;*/ return; } case ("Medium"): { e.Appearance.ForeColor = Color.Orange; /*e.Appearance.BackColor2 = Color.White;*/ return; } case ("High"): { e.Appearance.ForeColor = Color.Red; /*e.Appearance.BackColor2 = Color.White;*/ return; } default: { e.Appearance.ForeColor = Color.Gray; /* e.Appearance.BackColor2 = Color.White;*/ return; } } } else { e.Appearance.ForeColor = Color.Gray; //e.Appearance.BackColor2 = Color.White; } //e.Handled = true; } } }
private void Event_OnOrderGridViewRowCellStyle(object sender, RowCellStyleEventArgs e) { var status = Order_GridView.GetRowCellValue(e.RowHandle, Order_GridView.Columns[9]).ToString(); var noted = Order_GridView.GetRowCellValue(e.RowHandle, Order_GridView.Columns[10]).ToString(); Color selectedColor = default(Color); switch (status) { case "Success": //selectedColor = Color.Green; break; case "Waiting": selectedColor = Color.PaleGoldenrod; break; case "Canceled": selectedColor = Color.PaleVioletRed; break; case "Declined": selectedColor = Color.FromArgb(255, 150, 150); break; } if (status == "Waiting") { if (noted != ".") { selectedColor = Color.LimeGreen; } } if (!selectedColor.IsEmpty) { RGBAPix pix = selectedColor.ToRGBA(); HSLAPix hsl = pix; if (Order_GridView.IsRowSelected(e.RowHandle)) { hsl.l -= 0.10f; } else { if (e.RowHandle % 2 != 0) { hsl.l -= 0.05f; } } pix = hsl; e.Appearance.BackColor = (pix).ToWinColor(); } }
private void resultView_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as Prizm.Domain.Entity.Construction.Joint; if (data != null) { if (!data.IsActive) { e.Appearance.ForeColor = Color.Gray; } } }
private void gvExtintor_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { if (e.Column.FieldName == "FechaVencimiento") { e.Appearance.BackColor = Color.Red; e.Appearance.ForeColor = Color.White; } } }
/// <summary> /// Handles the RowCellStyle event of the gridViewSeasons control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs"/> instance containing the event data. /// </param> private void gridViewSeasons_RowCellStyle(object sender, RowCellStyleEventArgs e) { var season = this.gridViewSeasons.GetRow(e.RowHandle) as Season; if (season == null) { return; } e.Appearance.Font = season.ContainsChangedEpisodes() ? Get.LookAndFeel.TextChanged : Get.LookAndFeel.TextNormal; }
private void updateRowCellStyle(object sender, RowCellStyleEventArgs e) { var withValueOrigin = withValueOriginAt(e); if (withValueOrigin == null) { return; } var canEditValueOrigin = _valueOriginEditableFunc(withValueOrigin); _gridView.AdjustAppearance(e, canEditValueOrigin); }
private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView view = sender as GridView; if (e.Column != view.Columns["Name"]) { return; } if (Convert.ToInt32(view.GetRowCellValue(e.RowHandle, view.Columns["Number"])) > 300) { e.Appearance.BackColor = Color.Red; } }
private void gvDescansoMedico_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { if (e.Column.FieldName == "FechaFin") { e.Appearance.BackColor = Color.Red; e.Appearance.ForeColor = Color.White; } } }
private void onMatrixRowCellStyle(RowCellStyleEventArgs e) { var gridColumn = e.Column; if (columnIsHeaderColumn(gridColumn)) { return; } var value = Convert.ToDouble(e.CellValue); e.Appearance.BackColor = getColor(value); }
private void partsView_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as Part; if (data != null) { if (!data.IsActive) { e.Appearance.ForeColor = Color.Gray; } } }
private void grvCTCongNo_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { O_GIAODICH dl = View.GetRow(e.RowHandle) as O_GIAODICH; if (dl.TenKhach.Equals("TỔNG CỘNG:")) { e.Appearance.FontStyleDelta = FontStyle.Bold; } } }
private void gridViewPhone_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (e.RowHandle < 0) { return; } if (!e.Column.FieldName.Equals("amount_text")) { return; } if (e.Column.FieldName == "amount_text") { double Num; bool isNum = double.TryParse(gridViewPhone.GetRowCellValue(e.RowHandle, "amount_text").ToString(), out Num); if (gridViewPhone.GetRowCellValue(e.RowHandle, "amount_text").ToString() != "" && (isNum == true)) { if (gridViewPhone.GetRowCellValue(e.RowHandle, "amount_text").ToString() == "") { e.Appearance.BackColor = Color.Red; } else { if (gridViewPhone.GetRowCellValue(e.RowHandle, "amount_text").To <double>() >= 0) { if (Convert.ToDouble(gridViewPhone.GetRowCellValue(e.RowHandle, "amount")) < 0) { //e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Bold | FontStyle.Italic); e.Appearance.BackColor = Color.Red; } else { //e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Regular); e.Appearance.BackColor = Color.Green; } } else { //e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Regular); e.Appearance.BackColor = Color.Red; } } } else { e.Appearance.BackColor = Color.Red; } } }
//-----------------------------------------------------------------------------------------------------------------------------------------// private void grdLogView_RowCellStyle(object sender, RowCellStyleEventArgs e) { // GridView GridView p_GridView = sender as GridView; // Check if (e.RowHandle < 0) { return; } if (e.Column.FieldName == "STATUS") { // Get Text string p_CellValue = p_GridView.GetRowCellDisplayText(e.RowHandle, p_GridView.Columns[e.Column.FieldName]); // Set Fonts e.Appearance.ForeColor = Color.White; e.Appearance.Font = new Font("Tahoma", 8, FontStyle.Bold); // Set Color if (p_CellValue == alfaStr.DONE) { e.Appearance.BackColor = Color.Green; } else if (p_CellValue == alfaStr.ERROR) { e.Appearance.BackColor = Color.Red; } else if (p_CellValue == alfaStr.RUNNING) { e.Appearance.BackColor = Color.Blue; } } else if (e.Column.FieldName == "ID") { // Check Focused Row if (e.RowHandle == p_GridView.FocusedRowHandle) { return; } // Set Color e.Appearance.ForeColor = Color.Black; e.Appearance.BackColor = Color.LightGray; e.Appearance.Font = new Font("Tahoma", 8, FontStyle.Bold); } }
private void gridView_RowCellStyle(object sender, RowCellStyleEventArgs e) { DataTable dt = gridControl.DataSource as DataTable; if (dt == null || dt.Rows.Count < 1) { return; } if (gridView.GetDataRow(e.RowHandle)["是否批量异常"].ToString() == "是") { e.Appearance.BackColor = Color.Red; } }
public static void ColorGrid(this GridView view, GridColumn NameColumn, List<string> duplicates, RowCellStyleEventArgs e) { if (e.Column.ToString() == NameColumn.Caption) { if (duplicates.Count > 0) { foreach (var item in duplicates) { if ((e.CellValue != null) && (item == e.CellValue.ToString())) { e.Appearance.ForeColor = Color.Red; } } } } }
private void gridViewWelders_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as Welder; if (data != null) { if (!data.IsActive) { e.Appearance.ForeColor = Color.Gray; } if (data.Certificate.ExpirationDate <= weldDate.Date && data.IsActive) { e.Appearance.ForeColor = Color.Red; } } }
private void certificateTypesView_RowCellStyle(object sender, RowCellStyleEventArgs e) { DuplicatesList l = findDuplicateList[certificateTypesView]; List<string> certificateTypeDuplicates = l.Method(certificateTypesView); certificateTypesView.ColorGrid(certificateNameColumn, certificateTypeDuplicates, e); }
private void seemTypeGridView_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (viewModel.CurrentProjectSettings != null && viewModel.IsMill) { DuplicatesList l = findDuplicateList[seamTypeGridView]; List<string> seemTypeDuplicate = l.Method(seamTypeGridView); seamTypeGridView.ColorGrid(seamTypeColumn, seemTypeDuplicate, e); } }
private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (TipoPropuesta == Enums.TipoPersona.Cuenta) { if (CountPropuestas < (Convert.ToInt16(PropuestaCuentas) * 2)) { Color oBgcolor; oBgcolor = Color.AntiqueWhite; e.Appearance.BackColor = oBgcolor; e.Appearance.ForeColor = Color.Black; CountPropuestas++; } } if (TipoPropuesta == Enums.TipoPersona.Target) { if (CountPropuestas < Convert.ToInt16(PropuestaTargets)) { Color oBgcolor; oBgcolor = Color.AntiqueWhite; e.Appearance.BackColor = oBgcolor; e.Appearance.ForeColor = Color.Black; CountPropuestas++; } } }
private void gvRateHierDrawings_RowCellStyle(object sender, RowCellStyleEventArgs e) { var doc = (HierarchyNumberDrawing)gvRateHierDrawings.GetRow(e.RowHandle); if (e.Column.VisibleIndex % 2 == 1) e.Appearance.BackColor = Color.GhostWhite; if (doc?.Id != null) { if (Drawings.Any(x => x.ParentId == doc.Id)) { e.Appearance.FontStyleDelta = FontStyle.Bold; int probMaded = 0; lock (_probablyMadedsList) { probMaded = _probablyMadedsList.ContainsKey(doc) ? _probablyMadedsList[doc] : -1; } if (probMaded == doc.CountAll) e.Appearance.BackColor = Color.FromArgb(255, 205, 245, 185); if (probMaded > 0 && probMaded < doc.CountAll) e.Appearance.BackColor = Color.FromArgb(255, 255, 255, 135); } if (e.Column.Name.StartsWith(ColumnTechOperStart)) { var toId = Convert.ToInt32(e.Column.Name.Replace(ColumnTechOperStart, string.Empty)); var techRoute = TechRoutes.FirstOrDefault(x => x.Id == doc.TechRouteId); if (techRoute != null && techRoute.TechOperations.Any(x => x.Id == toId)) { e.Appearance.BackColor = Color.Linen; var maded = Madeds.FirstOrDefault(x => x.Drawing.Id == doc.Id && x.TechOperation.Id == toId); if (maded == null || maded.CountPlaced == 0) { e.Appearance.BackColor = Color.FromArgb(255, 255, 210, 210); } else { if (maded.CountProduced >= 0 && maded.CountProduced < doc.CountAll) e.Appearance.BackColor = Color.FromArgb(255, 255, 255, 135); else { if (maded.CountProduced > 0 && maded.CountProduced == doc.CountAll) e.Appearance.BackColor = Color.FromArgb(255, 205, 245, 185); } } } } } }
private void gviewLeft_RowCellStyle(object sender, RowCellStyleEventArgs e) { var channel = (ChannelInfo)this.gviewLeft.GetRow(e.RowHandle); if (channel == null) return; if (channel.OldProgramNr == -1) { e.Appearance.ForeColor = Color.Red; e.Appearance.Options.UseForeColor = true; } else if (channel.Hidden) { e.Appearance.ForeColor = Color.LightGray; e.Appearance.Options.UseForeColor = true; } else if (channel.Skip) { e.Appearance.ForeColor = Color.Blue; e.Appearance.Options.UseForeColor = true; } }
private void mainDataView_RowCellStyle(object sender, RowCellStyleEventArgs e) { // Ignore during closing. if (mainDataGrid.DataSource != null) { adjustCellColor(e); } }
private void gridViewVideo_RowCellStyle(object sender, RowCellStyleEventArgs e) { var videoInfo = gridViewVideo.GetRow(e.RowHandle) as VideoInfo; if (videoInfo == null) return; if (e.Column == gridColumnVideoMp4FileInfo) e.Appearance.ForeColor = String.IsNullOrEmpty(videoInfo.Mp4FilePath) ? Color.Red : Color.Green; e.Appearance.BackColor = videoInfo.Selected ? Color.LightGreen : Color.White; }
private void resultView_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as Prizm.Domain.Entity.Construction.Joint; if(data != null) { if(!data.IsActive) { e.Appearance.ForeColor = Color.Gray; } } }
private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView View = sender as GridView; if (e.Column.FieldName == "JudgeResult") { bool value = (bool) View.GetRowCellValue(e.RowHandle, View.Columns.ColumnByFieldName("JudgeResult")); if (value == true) { e.Appearance.BackColor = Color.Green; e.Appearance.BackColor2 = Color.DarkGreen; e.Appearance.ForeColor = Color.White; } else if (value == false) { e.Appearance.BackColor = Color.Red; e.Appearance.BackColor2 = Color.DarkRed; e.Appearance.ForeColor = Color.White; } } }
private void M_grv_hop_dong_RowCellStyle(object sender, RowCellStyleEventArgs e) { try { if (m_list_vi_tri_sai.Count == 0) { e.Appearance.BackColor = Color.White; } foreach (var item in m_list_vi_tri_sai) { if (item.chi_so_hang == e.RowHandle & item.chi_so_cot == e.Column.VisibleIndex) { e.Appearance.BackColor = Color.Red; } } if (co_ma_hop_dong_trung & e.Column.VisibleIndex == 2) { e.Column.AppearanceHeader.BackColor = Color.Red; } if (co_ma_nhan_vien_trung & e.Column.VisibleIndex == 1) { e.Column.AppearanceHeader.BackColor = Color.Red; } } catch (Exception ex) { set_init_form_load(); CSystemLog_301.ExceptionHandle(ex); } }
/// <summary> /// Handles the RowCellStyle event of the grdViewByTitle control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs"/> instance containing the event data.</param> private void GrdViewByTitle_RowCellStyle(object sender, RowCellStyleEventArgs e) { var row = grdViewByTitle.GetRow(e.RowHandle) as MovieModel; if (row == null) { return; } if (row.ChangedText || row.ChangedPoster) { e.Appearance.Font = Settings.Get.LookAndFeel.TextChanged; } else { e.Appearance.Font = Settings.Get.LookAndFeel.TextNormal; } }
private void pipesSizeListGridView_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (viewModel.CurrentProjectSettings != null && viewModel.IsMill) { DuplicatesList l = findDuplicateList[pipesSizeListGridView]; List<string> pipeSizesDuplicates = l.Method(pipesSizeListGridView); pipesSizeListGridView.ColorGrid(pipeSizeGridColumn, pipeSizesDuplicates, e); } }
private void gridViewInspectors_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as InspectorViewType; if (data != null) { foreach (InspectorCertificate c in data.Certificates) { if (c.Certificate.ExpirationDate < DateTime.Now) { e.Appearance.ForeColor = Color.Red; e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold); } } } }
private void OnGridBundleItemsRowCellStyle(object sender, RowCellStyleEventArgs e) { var bundleItem = ((GridView)sender).GetRow(e.RowHandle) as LibraryLinkItem; if (bundleItem != null && bundleItem.IsDead) e.Appearance.ForeColor = Color.Red; }
private void gridViewPermissions_RowCellStyle(object sender, RowCellStyleEventArgs e) { var view = sender as GridView; Permission p = view.GetRow(e.RowHandle) as Permission; if (!SecurityUtil.ExistOnCurrentWorkstation(p)) { e.Appearance.ForeColor = Color.Gray; } }
private void OnRowCellStyle(object sender, RowCellStyleEventArgs e) { var product = (DigitalProduct)advBandedGridView.GetRow(e.RowHandle); if (e.Column == gridColumnWidth || e.Column == gridColumnHeight) { if (e.CellValue == null) { e.Appearance.ForeColor = Color.Gray; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Italic); } else { e.Appearance.ForeColor = Color.DodgerBlue; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Regular); } } else if (e.Column == gridColumnCategory || e.Column == gridColumnSubCategory) { var availableSubcategories = ListManager.Instance.ProductSources.Where(x => x.Category != null && x.Category.Name.Equals(product.Category) && !string.IsNullOrEmpty(x.SubCategory)).Select(x => x.SubCategory).Distinct(); if (e.Column == gridColumnCategory) { if (!availableSubcategories.Any() || !String.IsNullOrEmpty(product.SubCategory)) e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Bold); } else if (e.Column == gridColumnSubCategory) { if (e.CellValue == null && availableSubcategories.Any()) { e.Appearance.ForeColor = Color.Gray; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Italic); } } } else if (e.Column == gridColumnName) { if (e.CellValue == null) { e.Appearance.ForeColor = Color.Gray; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Italic); } else { e.Appearance.ForeColor = Color.DodgerBlue; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Bold); } } else if (e.Column == gridColumnLocation && product.EnableLocation) { if (e.CellValue == null) { e.Appearance.ForeColor = Color.Gray; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Italic); } else { e.Appearance.ForeColor = Color.DodgerBlue; e.Appearance.Font = new Font(e.Appearance.Font.Name, e.Appearance.Font.Size, FontStyle.Regular); } } else if (e.Column == gridColumnTarget) { if (String.IsNullOrEmpty(product.Name) || !product.EnableTarget) { e.Appearance.ForeColor = Color.Gray; } else { e.Appearance.ForeColor = Color.Black; } } else if (e.Column == gridColumnRichMedia) { if (String.IsNullOrEmpty(product.Name) || !product.EnableRichMedia) { e.Appearance.ForeColor = Color.Gray; } else { e.Appearance.ForeColor = Color.Black; } } }
private void componentryTypeGridView_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (viewModel.CurrentProjectSettings != null && viewModel.IsMill) { DuplicatesList l = findDuplicateList[componentryTypeGridView]; List<string> componentryDuplicate = l.Method(componentryTypeGridView); componentryTypeGridView.ColorGrid(typeColumn, componentryDuplicate, e); } }
private void bgvBatchCalc2_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (e.Column == gv2col_Reading1 || e.Column == gv2col_Reading2) { CTemplate_method_aa method = new CTemplate_method_aaFactory().GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method)); // --- draw color style cell without result if (bgvBatchCalc2.GetRowCellValue(e.RowHandle, e.Column) != null) { string strReading = bgvBatchCalc2.GetRowCellValue(e.RowHandle, e.Column).ToString(); decimal reading = 0; if (decimal.TryParse(strReading, out reading)) { if (reading < method.Reading_min || reading > method.Reading_max) { e.Appearance.BackColor = Comun.ColorMorado; e.Appearance.Options.UseBackColor = true; } } } } if (e.Column == gv2col_Str_result_analysis) { if (tabTreeQaqc.SelectedTabPageIndex == 1) { CBatch_detail_aa_twofold oBatch_detail_aa_twofold = oDataBatch.ListSamples[e.RowHandle]; ///1 : incorrecto : rojo ///2 : plausible : ambar ///3 : aceptado : verde ///4 : incorrecto con observacion o reensayo : rojo if (oBatch_detail_aa_twofold.Qaqc_status_result == 1) e.Appearance.BackColor = Comun.ColorRojo; if (oBatch_detail_aa_twofold.Qaqc_status_result == 2) e.Appearance.BackColor = Comun.ColorAmbar; if (oBatch_detail_aa_twofold.Qaqc_status_result == 3) e.Appearance.BackColor = Comun.ColorVerde; if (oBatch_detail_aa_twofold.Qaqc_status_result == 4) e.Appearance.BackColor = Comun.ColorRojo; } } }
private void plateManufacturersListView_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (viewModel.CurrentProjectSettings != null && viewModel.IsMill) { DuplicatesList l = findDuplicateList[plateManufacturersListView]; List<string> plateManufacturersDuplicate = l.Method(plateManufacturersListView); plateManufacturersListView.ColorGrid(plateManufacturerGridColumn, plateManufacturersDuplicate, e); } }
private void gviewRight_RowCellStyle(object sender, RowCellStyleEventArgs e) { ChannelInfo channel = (ChannelInfo)this.gviewRight.GetRow(e.RowHandle); if (channel == null) return; if (channel.OldProgramNr == -1) { e.Appearance.ForeColor = Color.Red; e.Appearance.Options.UseForeColor = true; } else if (channel.GetPosition(this.subListIndex) != -1) { e.Appearance.ForeColor = Color.Gray; e.Appearance.Options.UseForeColor = true; } }
private void categoriesGridView_RowCellStyle(object sender, RowCellStyleEventArgs e) { DuplicatesList l = findDuplicateList[categoriesGridView]; List<string> categoriesDuplicate = l.Method(categoriesGridView); categoriesGridView.ColorGrid(categoryNameColumn, categoriesDuplicate, e); }
private void gridViewWelders_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as WelderViewType; if (data != null) { if ((e.Column.Name == colWelderCert.Name || e.Column.Name == colWelderCertExp.Name) && data.CertificateExpiration.Date < DateTime.Now) { e.Appearance.ForeColor = Color.Red; e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold); } } }
private void gridViewSummary_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (e.RowHandle < 0) return; string archiveFlag = ""; try { //GridView view = sender as GridView; //archiveFlag = view.GetRowCellDisplayText(e.RowHandle, view.Columns["ArchiveFlag"]); //if (archiveFlag != "N") //{ // e.Appearance.BackColor = Color.LightSteelBlue; // e.Appearance.BackColor2 = Color.LightSteelBlue; // e.Appearance.BorderColor = Color.LightSteelBlue; //} } catch (Exception ex) { XtraMessageBox.Show("An error occurred while attempting to apply a custom background color for certain columns." + Environment.NewLine + "Error CNF-100 in " + FORM_NAME + ".gridViewSummary_RowCellStyle(): " + ex.Message, MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gvDrawings_RowCellStyle(object sender, RowCellStyleEventArgs e) { var doc = (HierarchyNumberDrawing)gvRateHierDrawings.GetRow(e.RowHandle); if (e.Column.VisibleIndex%2 == 1) e.Appearance.BackColor = Color.GhostWhite; if (doc?.Id != null && e.Column.Name.StartsWith(ColumnTechOperStart) && _techOpersToDrawings.Any( x => x.Item1 == doc.Id && Convert.ToInt32(e.Column.Name.Replace(ColumnTechOperStart, string.Empty)) == x.Item2)) { e.Appearance.BackColor = Color.Linen; } }
private void inspectorCertificateGridView_RowCellStyle(object sender, RowCellStyleEventArgs e) { var inspc = gridViewInspectors.GetFocusedRow() as InspectorViewType; if (inspc != null) { GridView v = sender as GridView; var data = v.GetRow(e.RowHandle) as InspectorCertificate; if (data != null) { if (data.Certificate.ExpirationDate < DateTime.Now) { e.Appearance.ForeColor = Color.Red; e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold); } } } }
private void gridViewWMeterInRoom_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (e.RowHandle < 0) return; if (!e.Column.FieldName.Equals("total_unit")) return; if (e.Column.FieldName == "total_unit") { if (gridViewWMeterInRoom.GetRowCellValue(e.RowHandle, "total_unit").ToString() != "") { if (Convert.ToDouble(gridViewWMeterInRoom.GetRowCellValue(e.RowHandle, "total_unit")) < 0) { //e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Bold | FontStyle.Italic); e.Appearance.BackColor = Color.Red; } else { //e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Regular); e.Appearance.BackColor = Color.Green; } } } }
private void gvImportFileDataContact_RowCellStyle(object sender, RowCellStyleEventArgs e) { if (e.Column.FieldName.Equals("list_id") || e.Column.FieldName.Equals("id")) return; if (e.CellValue == null) return; if (e.CellValue.ToString().Contains("[«]")) e.Appearance.BackColor = Color.GreenYellow; else if ((e.CellValue.ToString().Contains("¶"))) e.Appearance.BackColor = Color.GreenYellow; }