/// <summary> /// Check row is tick, set color style /// </summary> /// <param name="grv">Check row is tick, set color style</param> public virtual void Get_ColorTick(GridView grv, object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["DANH_DAU"]); if (category == "T") { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle >= 0) { GridView view = sender as GridView; // Some condition var colorInt = view.GetRowCellValue(e.RowHandle, view.Columns["poscolor"]) != null ? (int)view.GetRowCellValue(e.RowHandle, view.Columns["poscolor"]) : 0; if (colorInt != 0) { e.Appearance.BackColor = Color.FromArgb(colorInt); } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["CreditoDebito"]); if (category == "Debito") { e.Appearance.BackColor = Color.Salmon; //Salmon e.Appearance.BackColor2 = Color.SeaShell; //SeaShell } else { e.Appearance.BackColor = Color.Green; e.Appearance.BackColor2 = Color.MediumSpringGreen; } } }
private void viewLevers_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle != GridControl.InvalidRowHandle && e.RowHandle != GridControl.AutoFilterRowHandle && e.RowHandle != GridControl.NewItemRowHandle) { var storeType = viewLevers.GetRowCellValue(e.RowHandle, DetailedWorkbenchInfo.colStoreType); var workBench = viewLevers.GetRowCellValue(e.RowHandle, DetailedWorkbenchInfo.colWorkBench); // Don't set row highlighting when alternative highlighting is enabled. if (viewLevers.OptionsView.EnableAppearanceEvenRow == false && viewLevers.OptionsView.EnableAppearanceOddRow == false && storeType != null && workBench != null) switch (storeType.ToString()) { case Constants.kBricksAndMortar: switch (workBench.ToString()) { case Constants.kDaily: e.Appearance.BackColor = Color.Bisque; break; case Constants.kWeekly: e.Appearance.BackColor = Color.PaleTurquoise; break; default: e.Appearance.BackColor = Color.White; break; } break; case Constants.kOnline: switch (workBench.ToString()) { case Constants.kDaily: e.Appearance.BackColor = Color.Thistle; break; case Constants.kWeekly: e.Appearance.BackColor = Color.LightSalmon; break; default: e.Appearance.BackColor = Color.White; break; } break; default: e.Appearance.BackColor = Color.White; break; } } }
/// <summary> /// Handles rows background colour based on the StoreType and WorkbenchType /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void view_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle != GridControl.InvalidRowHandle && e.RowHandle != GridControl.AutoFilterRowHandle && e.RowHandle != GridControl.NewItemRowHandle) { var storeType = GetCurrentView().GetRowCellValue(e.RowHandle, SummaryWorkbenchInfo.GetSummaryItemName(SummaryWorkbenchInfo.SummaryItemColumns.StoreType)); var workBench = GetCurrentView().GetRowCellValue(e.RowHandle, SummaryWorkbenchInfo.GetSummaryItemName(SummaryWorkbenchInfo.SummaryItemColumns.WorkBench)); var market = GetCurrentView().GetRowCellValue(e.RowHandle, SummaryWorkbenchInfo.GetSummaryItemName(SummaryWorkbenchInfo.SummaryItemColumns.Market)); var classCell = GetCurrentView().GetRowCellValue(e.RowHandle, SummaryWorkbenchInfo.GetSummaryItemName(SummaryWorkbenchInfo.SummaryItemColumns.Class)); if (storeType != null && workBench != null) switch (storeType.ToString()) { case Constants.kBricksAndMortar: switch (workBench.ToString()) { case Constants.kDaily: e.Appearance.BackColor = Color.Bisque; break; case Constants.kWeekly: e.Appearance.BackColor = Color.PaleTurquoise; break; default: e.Appearance.BackColor = Color.White; break; } break; case Constants.kOnline: switch (workBench.ToString()) { case Constants.kDaily: e.Appearance.BackColor = Color.Thistle; break; case Constants.kWeekly: e.Appearance.BackColor = Color.LightSalmon; break; default: e.Appearance.BackColor = Color.White; break; } break; default: e.Appearance.BackColor = Color.White; break; } } }
public void SetStyleOfGridCell(object data, RowStyleEventArgs args) { }
private void gridInvoiceDetail_RowStyle(object sender, RowStyleEventArgs e) { var view = sender as GridView; if (e.RowHandle >= 0 && view != null) { var isSaved = view.GetRowCellValue(e.RowHandle, view.Columns["IsSaved"]); e.Appearance.BackColor = (isSaved != null && (bool)isSaved) ? Color.White : Color.LightBlue;//for saved receiptInvoiceDetails use background color = White else CornflowerBlue } }
private void gridItemChoiceView_RowStyle(object sender, RowStyleEventArgs e) { var view = sender as GridView; if (e.RowHandle >= 0) { if (view.GetRowCellValue(e.RowHandle, view.Columns["gridColumn15"]).Equals("Expired")) { e.Appearance.BackColor = Color.Green; } } }
private void gridView_RowStyle(object sender, RowStyleEventArgs e) { BaseWMItemView item = (BaseWMItemView)gridView.GetRow(e.RowHandle); if (item == null) return; if (item.Checked) { e.Appearance.BackColor = Color.GreenYellow; } }
void vw_RowStyle(object sender, RowStyleEventArgs e) { if (string.IsNullOrEmpty(ColorFieldName)) return; if (e.RowHandle < 0) return; if (DefGridView.GetRowCellValue(e.RowHandle, ColorFieldName) == null) return; e.Appearance.BackColor = DefGridView.GetRowCellValue(e.RowHandle, ColorFieldName).ToString().ToColor(); }
void view_RowStyle(object sender, RowStyleEventArgs e) { if (IsRowSelected(e.RowHandle)) { //e.Appearance.BackColor = SystemColors.Highlight; //e.Appearance.ForeColor = SystemColors.HighlightText; } }
private void gridView4_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { var estado = View.GetRowCellDisplayText(e.RowHandle, View.Columns["Estado"]); bool estado2 = Convert.ToBoolean(View.GetRowCellValue(e.RowHandle, View.Columns["Estado"])); if (estado2) { e.Appearance.ForeColor = Color.Green; } else { e.Appearance.ForeColor = Color.Red; } } }
private void gridViewObs_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; int Diferencia = 0; if (e.RowHandle >= 0) { DateTime FechaObservacion = (DateTime)View.GetRowCellValue(e.RowHandle, gridFechaHora); DateTime FechaHoy = DateTime.Now.Date; Diferencia = DateTime.Compare(FechaHoy, FechaObservacion.Date); //Actualizado hoy if (Diferencia == 0) { e.Appearance.BackColor = Color.Yellow; e.Appearance.BackColor2 = Color.SeaShell; } } }
private void highlightRowsBelowLLOQ(RowStyleEventArgs e) { if (e.RowHandle < 0 || e.RowHandle >= gridView.RowCount) { return; } var sourceRow = gridView.GetDataSourceRowIndex(e.RowHandle); var table = gridControl.DataSource as DataTable; if (table == null) { return; } var color = _presenter.BackgroundColorForRow(sourceRow); gridView.AdjustAppearance(e, color); }
private void avdGridView_RowStyle(object sender, RowStyleEventArgs e) { GridView view = sender as GridView; if (e.RowHandle == view.FocusedRowHandle && !view.IsGroupRow(e.RowHandle)) { if (view.GetRowCellValue(e.RowHandle, colBA).ToString() == "A") { e.Appearance.ForeColor = Color.Red; e.Appearance.BackColor = Color.LightCyan; } else { e.Appearance.ForeColor = Color.Blue; e.Appearance.BackColor = Color.LightCyan; } e.HighPriority = true; } }
private void gridView2_RowStyle(object sender, RowStyleEventArgs e) { object quantity = (gridView2.GetRowCellValue(e.RowHandle, "OdemeTarihi") == null) ? null : gridView2.GetRowCellValue(e.RowHandle, "OdemeTarihi"); if (quantity == null) { if (Convert.ToDateTime(gridView2.GetRowCellValue(e.RowHandle, "VadeTarihi")) < DateTime.Now.Date) { e.Appearance.BackColor = Color.LightPink; //vade tarihi geçmiş } else { e.Appearance.BackColor = Color.LightYellow; //vade tarihi gelmemiş } } else { e.Appearance.BackColor = Color.LightGreen; //ödenmiş } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { bool archived = (bool)View.GetRowCellValue(e.RowHandle, View.Columns["Archived"]); bool agency = (bool)View.GetRowCellValue(e.RowHandle, View.Columns["Agency"]); if (agency) { e.Appearance.BackColor = Color.FromArgb(150, Color.LightGray); e.Appearance.BackColor2 = Color.White; } if (archived) { e.Appearance.BackColor = Color.FromArgb(150, Color.Black); e.Appearance.BackColor2 = Color.White; } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { try { GridView View = sender as GridView; if (e.RowHandle >= 0) { string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["Error"]); int mod = e.RowHandle % 2; //odd=1 , even=0 if (mod == 1) { if (category == "1") { e.Appearance.BackColor = Color.Salmon; } else { e.Appearance.BackColor = Color.DarkGray; } } if (mod == 0) { if (category == "1") { e.Appearance.BackColor = Color.Salmon; } else { e.Appearance.BackColor = Color.White; } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void GridView__RowStyle(object sender, RowStyleEventArgs e) { //try //{ // if (rowhandles.Any(x => x == e.RowHandle)) // { // if (color1 != null && color2 != null) // { // e.Appearance.BackColor = color1; // e.Appearance.BackColor2 = color2; // } // } //} //catch //{ //} GridView View = sender as GridView; if (e.RowHandle >= 0) { //string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["ALT"]); //if (category == "+") //{ // e.Appearance.BackColor = Color.Yellow; // e.Appearance.BackColor2 = Color.LightYellow; //} } if (e.RowHandle >= 0) { //string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["DAHIL_HARIC"]); //if (category == "Hariç") //{ // e.Appearance.BackColor = Color.LavenderBlush; //// e.Appearance.BackColor2 = Color.LightCoral; //} } }
void gridView_RowStyle(object sender, RowStyleEventArgs e) { ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity; GridView view = sender as GridView; GridView gridView = (GridView)MainView; if (e.RowHandle >= 0) { if (e.RowHandle == gridView.FocusedRowHandle) { e.Appearance.ForeColor = Color.Black; e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold); } HRTimeKeeperCompletesInfo objTimeKeeperCompletesInfo = (HRTimeKeeperCompletesInfo)gridView.GetRow(e.RowHandle); if (objTimeKeeperCompletesInfo != null) { bool isSameTime = ((ManagerTimeKeeperModule)Screen.Module).CheckSameTime(objTimeKeeperCompletesInfo, entity.TimeKeeperCompleteListView); } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e)// sự kiện trong gridview , hiện màu nếu ngay giao hang gan bang ngay hien tai { //try //{ // if (sender is GridView view) // { // var capnhat = view.GetRowCellDisplayText(e.RowHandle, view.Columns["ChinhSua"]); // switch (capnhat) // { // case "1": // e.Appearance.BackColor = Color.AntiqueWhite; // break; // } // var ngaygiaohang = view.GetRowCellValue(e.RowHandle, view.Columns["NgayGiaoHang"]); // var dispText = (Convert.ToDateTime(ngaygiaohang) - DateTime.Today).Days.ToString(); // switch (dispText) // { // case "0": // e.Appearance.BackColor = Color.OrangeRed; // e.Appearance.BackColor2 = Color.White; // break; // case "1": // case "2": // e.Appearance.BackColor = Color.LightSalmon; // e.Appearance.BackColor2 = Color.White; // break; // } // } //} //catch (Exception) //{ // // ignored //} }
private void outboundView_RowStyle(object sender, RowStyleEventArgs e) { if (gridView.GetRowCellValue(e.RowHandle, "Status") == null) { return; } string status = gridView.GetRowCellValue(e.RowHandle, "Status").ToString(); if (status == DealStatus.PreSell) { e.Appearance.ForeColor = Color.Red; } else if (status == DealStatus.Outbound) { e.Appearance.ForeColor = Color.Blue; } else if (status == DealStatus.Finish) { e.Appearance.ForeColor = Color.Black; } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { //try //{ // if (e.RowHandle < 0) return; // var db = new MyDBContextDataContext(); // if (sender is GridView view) // { // var _Item = view.GetRowCellValue(e.RowHandle, "Item").ToString(); // var lst = db.tbStandards.Where(s => s.ItemCode == _Item).ToList(); // if (lst.Count != 0) return; // e.Appearance.BackColor = Color.PaleVioletRed; // //MessageBox.Show("Item = " + _Item + " không có,hãy thêm Item vào Standard"); // btnSave.Enabled = false; // } //} //catch (Exception) //{ // // ignored //} }
private void GVDanhSachTiepNhan_RowStyle(object sender, RowStyleEventArgs e) { try { GridView View = sender as GridView; if (e.RowHandle >= 0) { bool isDaNhapLieu = View.GetRowCellDisplayText(e.RowHandle, View.Columns["isDaNhapLieu"]) == null?false:(bool)View.GetRowCellValue(e.RowHandle, this.col_isDaNhapLieu); if (!isDaNhapLieu) { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } else { e.Appearance.BackColor = Color.Aqua; e.Appearance.BackColor2 = Color.AliceBlue; } } } catch { } }
private void gridView3_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; bool paid = true; if (e.RowHandle >= 0) { int studentID = Convert.ToInt32(View.GetRowCellDisplayText(e.RowHandle, View.Columns["م"])); foreach (DataRow dr in dt.Rows) { if (Convert.ToInt32(dr["م"]) == studentID) { paid = Convert.ToBoolean(dr["الدفع"]); } } if (!paid) { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SandyBrown; } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { string valor = ""; try { valor = miEntidadPersona.IdPersona.ToString(); } catch (Exception exception) { valor = ""; } GridView view = sender as GridView; if (e.RowHandle >= 0) { //int ver = 0; string miIdPersona = view.GetRowCellDisplayText(e.RowHandle, view.Columns["IdPersona"]); if (miIdPersona == valor) { e.Appearance.BackColor = Color.Green; e.Appearance.BackColor2 = Color.SeaShell; e.HighPriority = true; //view.MakeRowVisible(e.RowHandle, true); //ver = RowVisibleState.Visible; //view.IsRowVisible(e.RowHandle,RowVisibleState); } else { //e.Appearance.BackColor = Color.DarkGray; //e.Appearance.BackColor2 = Color.Black; //view.IsRowVisible(e.RowHandle, 0); //view.MakeRowVisible(e.RowHandle, false); //ver = RowVisibleState.Hidden; } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView; if (e.RowHandle >= 0) { string category = view.GetRowCellDisplayText(e.RowHandle, view.Columns["项目状态"]); if (category == "成功") { e.Appearance.BackColor = Color.LightGreen; //e.Appearance.BackColor2 = Color.SeaShell; } else if (category == "暂停") { e.Appearance.BackColor = Color.Coral; //e.Appearance.BackColor2 = Color.SeaShell; } else if (category == "完成") { e.Appearance.BackColor = Color.LightGray; //e.Appearance.BackColor2 = Color.SeaShell; } } }
//private void Form_Shown(object sender, EventArgs e) //{ // if (lci5 != null) // { // lci5.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; // } //} private void View_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle >= 0 && gridView1.IsDataRow(e.RowHandle)) { object slChay = gridView1.GetRowCellValue(e.RowHandle, "SlChay"); object slTon = gridView1.GetRowCellValue(e.RowHandle, "SlTon"); if (slChay == DBNull.Value || slTon == DBNull.Value) { e.Appearance.BackColor = Color.Transparent; } else { if (decimal.Parse(slChay.ToString()) > decimal.Parse(slTon.ToString())) { e.Appearance.BackColor = Color.OrangeRed; } else { e.Appearance.BackColor = Color.Transparent; } } } }
private void GvMain_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { double sln = Convert.ToDouble(View.GetRowCellDisplayText(e.RowHandle, View.Columns["Số lượng nhập"]).Trim()); double slpo = Convert.ToDouble(View.GetRowCellDisplayText(e.RowHandle, View.Columns["SLPO"]).Trim()); if (sln > slpo + 5) { //green e.Appearance.BackColor = Color.LightGreen; e.Appearance.BackColor2 = Color.LightGreen; } else if (sln > 0 && sln < slpo - 5) { //red e.Appearance.BackColor = Color.LightSalmon; e.Appearance.BackColor2 = Color.LightSalmon; } } }
void gvMain_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle >= 0 && gvMain.IsDataRow(e.RowHandle)) { object slbg = gvMain.GetRowCellValue(e.RowHandle, "SLBG"); object sldh = gvMain.GetRowCellValue(e.RowHandle, "SoLuong"); if (slbg == DBNull.Value || sldh == DBNull.Value) { e.Appearance.BackColor = Color.Transparent; } else { if (decimal.Parse(slbg.ToString()) > decimal.Parse(sldh.ToString())) { e.Appearance.BackColor = Color.Red; } else { e.Appearance.BackColor = Color.Transparent; } } } }
private void listGridView_RowStyle(object sender, RowStyleEventArgs e) { //GridView View = sender as GridView; //if (e.RowHandle >= 0) //{ // string status = View.GetRowCellDisplayText(e.RowHandle, View.Columns["Status"]); // if (status == "คืนของผิดเงื่อนไข") // { // e.Appearance.BackColor = Color.PaleVioletRed; // e.Appearance.ForeColor = Color.White; // } // else if (status == "เปลี่ยนสินค้า") // { // e.Appearance.BackColor = Color.CornflowerBlue; // e.Appearance.ForeColor = Color.White; // } // else if (status == "คืนเงิน") // { // e.Appearance.BackColor = Color.MediumSeaGreen; // e.Appearance.ForeColor = Color.White; // } //} }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { Task task = (Task)View.GetRow(e.RowHandle); string status = View.GetRowCellDisplayText(e.RowHandle, View.Columns["Status.opis"]); if (status == "Zavrseno") { e.Appearance.BackColor = Color.LightGray; goto kraj; } string prioritet = View.GetRowCellDisplayText(e.RowHandle, View.Columns["Prioritet.opis"]); if (prioritet == "High") { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } if (prioritet == "Low") { //e.Appearance.BackColor = Color.LightYellow; //e.Appearance.BackColor2 = Color.LightGoldenrodYellow; } if (prioritet == "Medium") { e.Appearance.BackColor = Color.LightYellow; e.Appearance.BackColor2 = Color.LightGoldenrodYellow; } kraj :; } }
private void gvFiles_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { string category = View.GetRowCellDisplayText(e.RowHandle, gridColumn2); if (category == "Hợp lệ") { e.Appearance.BackColor = Color.Green; e.Appearance.BackColor2 = Color.SeaShell; } else if (category == "Không hợp lệ") { e.Appearance.BackColor = Color.Red; e.Appearance.BackColor2 = Color.SeaShell; } else { e.Appearance.BackColor = Color.White; e.Appearance.BackColor2 = Color.SeaShell; } } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0 && View.IsDataRow(e.RowHandle)) { object duyet = View.GetRowCellValue(e.RowHandle, "duyet"); object ngaygiahan = View.GetRowCellValue(e.RowHandle, "NgayGHT"); if (duyet == DBNull.Value || Convert.ToBoolean(duyet) == false || ngaygiahan == DBNull.Value) { return; } var ngaygh = (DateTime)ngaygiahan; if (ngaygh < DateTime.Today) { e.Appearance.BackColor = Color.Red; } else { e.Appearance.BackColor = Color.Green; } } }
private void gridView_RowStyle(object sender, RowStyleEventArgs e) { var view = sender as GridView; if (e.RowHandle < 0) { return; } if (view == null) { return; } var state = (int)view.GetRowCellValue(e.RowHandle, view.Columns["State"]); var isActive = (bool)view.GetRowCellValue(e.RowHandle, view.Columns["IsActive"]); if (state == 3 || state == 4 || state == 5) { e.Appearance.ForeColor = Color.Navy; } if (isActive) { e.Appearance.ForeColor = Color.Red; } }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (View.Columns.Count < 8) { return; } // 由實體機器與DB比對的呈現邏輯 if (View.Columns.Count == 8 && View.Columns[7].FieldName.Equals("IsInDB")) { if (e.RowHandle < 0) { return; } string isInDb = View.GetRowCellDisplayText(e.RowHandle, View.Columns["IsInDB"]); if (isInDb.Length <= 0) { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } } else if (View.Columns.Count == 11 && View.Columns[10].FieldName.Equals("IsInCisco")) { if (e.RowHandle < 0) { return; } string isInCisco = View.GetRowCellDisplayText(e.RowHandle, View.Columns["IsInCisco"]); if (isInCisco.Length <= 0) { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } } }
private void advBandedGridView4_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { if ((View.GetRowCellValue(e.RowHandle, View.Columns["viza"])) is DBNull) { e.Appearance.BackColor = Color.FromArgb(0xCC, 0xCC, 0xFF); e.Appearance.ForeColor = Color.Black; } else { var ll = View.GetRowCellDisplayText(e.RowHandle, View.Columns["for_info"]); if ((bool)(View.GetRowCellValue(e.RowHandle, View.Columns["for_info"])) != false) { e.Appearance.BackColor = Color.Yellow; e.Appearance.ForeColor = Color.Black; } else { var ll1 = View.GetRowCellDisplayText(e.RowHandle, View.Columns["otvet1"]); if ((View.GetRowCellDisplayText(e.RowHandle, View.Columns["otvet1"])) != "" && (bool)(View.GetRowCellValue(e.RowHandle, View.Columns["control"])) == true) { e.Appearance.BackColor = Color.YellowGreen; e.Appearance.ForeColor = Color.Black; } else { e.Appearance.BackColor = Color.Pink; e.Appearance.ForeColor = Color.Black; } } } } }
private void gridViewADOdotNETDataTable_RowStyle(object sender, RowStyleEventArgs e) { GridView view = sender as GridView; if (view == null || e.RowHandle < 0) { return; } DataRowView dataRowView = view.GetRow(e.RowHandle) as DataRowView; if (dataRowView == null) { return; } string idPropertyName = "id"; DataRow row = dataRowView.Row; if (row == null || !row.Table.Columns.Contains(idPropertyName)) { return; } if (Math.Abs(Convert.ToInt64(row[idPropertyName])) % 2 == 0) { AppearanceObject appearanceObject = new AppearanceObject(); appearanceObject.BackColor = Color.Red; appearanceObject.ForeColor = Color.White; if ((e.State & GridRowCellState.Focused) == GridRowCellState.Focused) { appearanceObject.Font = new Font(e.Appearance.Font, FontStyle.Bold); } e.CombineAppearance(appearanceObject); } }
private void Tablo_RowStyle(object sender, RowStyleEventArgs e) { if (!IsRowSelected(e.RowHandle)) return; e.Appearance.BackColor = SystemColors.Highlight; e.Appearance.ForeColor = SystemColors.HighlightText; }
private void gvPTerm_RowStyle(object sender, RowStyleEventArgs e) { }
private void gvSize_RowStyle(object sender, RowStyleEventArgs e) { }
private void gvCustomer_RowStyle(object sender, RowStyleEventArgs e) { }
private void gridViewRqmt_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle < 0) return; string colorStr; //Boolean isRowSelected; Color color; try { GridView view = sender as GridView; //isRowSelected = (view.IsRowSelected(e.RowHandle)); //e.Appearance.Assign(view.PaintAppearance.SelectedRow); colorStr = view.GetRowCellDisplayText(e.RowHandle, "GuiColorCode"); //color = Color.FromName((string)translateColors[colorStr]); color = TranslateColor(colorStr); e.Appearance.BackColor = color; e.Appearance.ForeColor = Color.Black; } #pragma warning disable 0168 //Disable warning... catch (Exception ex) #pragma warning restore 0168 { //XtraMessageBox.Show("gridViewRqmt_CustomDrawCell: " + ex.Message, // "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gridViewEdu_RowStyle(object sender, RowStyleEventArgs e) { var grid = (GridView) sender; if (e.RowHandle > 0) { var edu = grid.GetRow(e.RowHandle); var hasForm = edu.GetAttachedProperty("bHasForm"); if (hasForm == null) return; if ((bool)hasForm) return; e.Appearance.BackColor = Color.FromArgb(76, 211, 211, 211); } }
private void gridView3_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { string Tope = View.GetRowCellDisplayText(e.RowHandle, View.Columns["TieneTopeHorario"]); if (Tope == "Seleccionado") { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } } }
private void gvShowFeeds_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle == _rowHandle) { e.Appearance.BackColor = Color.Salmon; e.Appearance.BackColor2 = Color.SeaShell; } }
private void gridViewInboundDocs_RowStyle(object sender, RowStyleEventArgs e) { bool hasUnResolvedChildren = false; GridView activeGridView = null; activeGridView = (GridView)gridControlInboundDocs.DefaultView; if (e.RowHandle >= 0) { string autoAssociatedFlag = activeGridView.GetRowCellValue(e.RowHandle, "HasAutoAsctedFlag").ToString(); hasUnResolvedChildren = (activeGridView.GetRowCellValue(e.RowHandle, "UnresolvedCount").ToString() != "0"); if (hasUnResolvedChildren) { if (autoAssociatedFlag.Equals("Y")) { e.Appearance.BackColor = Color.AliceBlue; e.Appearance.BackColor2 = Color.CadetBlue; } else { e.Appearance.BackColor = Color.YellowGreen; e.Appearance.BackColor2 = Color.Yellow; } } } }
private void gridLookUpEdit1View_RowStyle(object sender, RowStyleEventArgs e) { var view = sender as GridView; if (e.RowHandle >= 0) { bool isElectronic = Convert.ToBoolean(view.GetRowCellValue(e.RowHandle,"IsElectronic")); bool active = Convert.ToBoolean(view.GetRowCellValue(e.RowHandle, "Active")); if (isElectronic) { e.Appearance.BackColor = Color.LightBlue; } if (!active) { e.Appearance.BackColor = Color.DarkGray; e.Appearance.Font = new Font(view.Appearance.Row.Font,FontStyle.Italic); e.Appearance.ForeColor = Color.White; } } }
private void gvDrawings_RowStyle(object sender, RowStyleEventArgs e) { var draw = gvRateHierDrawings.GetRow(e.RowHandle) as Drawing; if (draw != null) { var source = gcDrawings.DataSource as List<HierarchyNumberDrawing>; if (source != null) { if (source.Any(x => x.ParentId == draw.Id)) e.Appearance.FontStyleDelta = FontStyle.Bold; } } }
private void grvArticulos_RowStyle(object sender, RowStyleEventArgs e) { GridView view = sender as GridView; if (e.RowHandle < 0) return; if (view == null) return; string estado = view.GetRowCellDisplayText(e.RowHandle, view.Columns["Estado"]); switch(estado) { case "Disponible": e.Appearance.BackColor = Color.DarkSeaGreen; break; case "Vendido": e.Appearance.BackColor = Color.LightCoral; break; case "Apartado": e.Appearance.BackColor = Color.Yellow; break; } }
private void gridViewDetail_RowStyle(object sender, RowStyleEventArgs e) { if (gridViewDetail.IsGroupRow(e.RowHandle)) return; DataRow r = gridViewDetail.GetDataRow(e.RowHandle); if (_dtGioPhat == null || r == null || r[KE_HOACH_LPS_CT.GIO_PHAT_SONG] is DBNull) return; var gioPhat = (DateTime)r[KE_HOACH_LPS_CT.GIO_PHAT_SONG]; if (gioPhat.ToString("HH:mm") == "23:55") { e.Appearance.BackColor = Color.Gainsboro; e.Appearance.Options.UseBackColor = true; } else { DataRow[] rr = _dtGioPhat.Select(KE_HOACH_LPS_CT.GIO_PHAT_SONG + "='" + r[KE_HOACH_LPS_CT.GIO_PHAT_SONG] + "'"); if (rr.Length > 0) { int index = _dtGioPhat.Rows.IndexOf(rr[0]); e.Appearance.BackColor = index % 2 == 0 ? Color.White : Color.FromArgb(255, 255, 153); e.Appearance.Options.UseBackColor = true; } } ColVet.AppearanceCell.ForeColor = Color.Black; }
private void gvDrawings_RowStyle(object sender, RowStyleEventArgs e) { var draw = gvDrawings.GetRow(e.RowHandle) as Drawing; if (draw != null) { var source = gcDrawings.DataSource as List<HierarchyNumberDrawing>; if (source != null) { if (source.Any(x => x.ParentId == draw.Id)) e.Appearance.FontStyleDelta = FontStyle.Bold; } if (MarkDrawingsInSsi) { if (_standartDrawings.Any(x => x.Equals(draw))) e.Appearance.BackColor = Color.Bisque; } } }
private void gridViewSummary_RowStyle(object sender, RowStyleEventArgs 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") { DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo vi = view.GetViewInfo() as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo; if (e.RowHandle % 2 == 0) e.Appearance.Assign(vi.PaintAppearance.OddRow); else e.Appearance.Assign(vi.PaintAppearance.EvenRow); } //else //{ // 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 rows." + Environment.NewLine + "Error CNF-101 in " + FORM_NAME + ".gridViewSummary_RowStyle(): " + ex.Message, MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gridViewDetail_RowStyle(object sender, RowStyleEventArgs e) { if (gridViewDetail.IsGroupRow(e.RowHandle)) return; DataRow r = gridViewDetail.GetDataRow(e.RowHandle); if (_dtGioPhat == null || r == null || r[KE_HOACH_LPS_CT.GIO_PHAT_SONG] is DBNull) return; var gioPhat = (DateTime)r[KE_HOACH_LPS_CT.GIO_PHAT_SONG]; if (gioPhat.ToString("HH:mm") == "23:55") { e.Appearance.BackColor = Color.Gainsboro; e.Appearance.Options.UseBackColor = true; } else { DataRow[] rr = _dtGioPhat.Select(KE_HOACH_LPS_CT.GIO_PHAT_SONG + "='" + r[KE_HOACH_LPS_CT.GIO_PHAT_SONG] + "'"); if (rr.Length > 0) { int index = _dtGioPhat.Rows.IndexOf(rr[0]); e.Appearance.BackColor = index % 2 == 0 ? Color.White : Color.FromArgb(255, 255, 153); e.Appearance.Options.UseBackColor = true; } if (!(r[KE_HOACH_LPS_CT.NGAY_BAT_DAU] is DBNull) && !(r[KE_HOACH_LPS_CT.NGAY_PHAT_CUOI] is DBNull)) { var start = (DateTime)r[KE_HOACH_LPS_CT.NGAY_BAT_DAU]; var end = (DateTime)r[KE_HOACH_LPS_CT.NGAY_PHAT_CUOI]; if (DateTime.Today.Date >= start.Date && DateTime.Today.Date <= end.Date) { e.Appearance.ForeColor = Color.Red; e.Appearance.Font = new Font(gridViewDetail.Appearance.Row.Font, FontStyle.Bold); e.Appearance.Options.UseFont = true; e.Appearance.Options.UseForeColor = true; } } } ColGioPhat.AppearanceCell.ForeColor = Color.Black; }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { }
private void gridView1_RowStyle(object sender, RowStyleEventArgs e) { _unit.Get_ColorTick(gridView1, sender, e); }
private void gvUnit_RowStyle(object sender, RowStyleEventArgs e) { }
private void gridView_RowStyle(object sender, RowStyleEventArgs e) { if (e.RowHandle > -1 && SetStyleOfGridRow != null && e.RowHandle != gridView.FocusedRowHandle) { BaseEntity data = (BaseEntity)gridView.GetRow(e.RowHandle); SetStyleOfGridRow(data, e); } }
private void gridView4_RowStyle(object sender, RowStyleEventArgs e) { GridView View = sender as GridView; if (e.RowHandle >= 0) { var estado2 = Convert.ToBoolean(View.GetRowCellValue(e.RowHandle, View.Columns["Estado"])); e.Appearance.ForeColor = estado2 ? Color.Green : Color.Red; } }
private void gvEventLog_RowStyle(object sender, RowStyleEventArgs e) { if (e == null) return; CTScEventAndFollowUpLog _item = gvEventLog.GetRow(e.RowHandle) as CTScEventAndFollowUpLog; if (_item == null) return; if (!_item.done) e.Appearance.BackColor = Color.YellowGreen; }