protected virtual void Grilla_CellFormatting(object sender, CellFormattingEventArgs e) { GridCommandCellElement cmdCell = e.CellElement as GridCommandCellElement; if (cmdCell != null) { cmdCell.CommandButton.ImageAlignment = ContentAlignment.MiddleCenter; } }
private void gridCardValuation_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridFilterCellElement) { if (e.CellElement.ColumnInfo.Name != "Card") { e.CellElement.Visibility = ElementVisibility.Collapsed; } } }
private void gvPenerima_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridHeaderCellElement) { Padding pad = new System.Windows.Forms.Padding(2); e.CellElement.Font = new Font("Segoe UI", (float)9, FontStyle.Bold); e.CellElement.Padding = pad; e.CellElement.TextAlignment = ContentAlignment.MiddleLeft; } }
private void grdLister_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.Column != null && e.Row != null && e.Row.Cells["Id"].Value != null) { if (e.Column.Name == "Name") { e.CellElement.Font = f; } } }
protected virtual void GridView_CellFormatting(object sender, CellFormattingEventArgs e) { if (HongKongSupplementaryCharacterSet) { if (((Telerik.WinControls.UI.GridViewDataColumn)(e.CellElement.ColumnInfo)).FieldName.ToUpper().Contains("LOCALNAME")) { e.CellElement.Font = _HkSupplementaryFont; } } }
void grdItems_CellFormatting(object sender, CellFormattingEventArgs e) { try { if (!(e.CellElement is GridCommandCellElement)) { return; } if (e.Column.Name.Equals("Edit")) { var bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.ImageAlignment = ContentAlignment.MiddleCenter; bte.Image = Resources.editar16x16; bte.ToolTipText = @"Editar Registro"; bte.AutoSize = true; } } if (e.Column.Name.Equals("Delete")) { var bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.ImageAlignment = ContentAlignment.MiddleCenter; bte.Image = Resources.Sign_07; bte.ToolTipText = @"Eliminar Registro"; bte.AutoSize = true; } } if (e.Column.Name.Equals("Print")) { var bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.ImageAlignment = ContentAlignment.MiddleCenter; bte.Image = Resources.printer2; bte.ToolTipText = @"Imprimir"; bte.AutoSize = true; } } if (e.CellElement.RowInfo is GridViewNewRowInfo && e.CellElement.ColumnInfo is GridViewCommandColumn) { e.CellElement.Children[0].Visibility = ElementVisibility.Hidden; } } catch (Exception ex) { Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error al formatear el icono." + ex.Message); } }
/// <summary> /// Ustawia prawidłowe wartości komórek. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">CellFormattingEventArgs.</param> private void CarProductCollectionGrid_CellFormatting(object sender, CellFormattingEventArgs e) { if ((CarProductCollectionGrid.Rows[e.RowIndex].DataBoundItem != null) && (CarProductCollectionGrid.Columns[e.ColumnIndex].FieldName.Contains("."))) { e.CellElement.Value = PropertyBindingManager.BindProperty( CarProductCollectionGrid.Rows[e.RowIndex].DataBoundItem, CarProductCollectionGrid.Columns[e.ColumnIndex].FieldName ); } }
protected override void OnCellFormatting(CellFormattingEventArgs e) { base.OnCellFormatting(e); if ((e.Value is int && (int)e.Value < 0) || (e.Value is long && (long)e.Value < 0L) || (e.Value is decimal && (decimal)e.Value < 0M)) { e.CellStyle.ForeColor = NegativeForeColor; e.CellStyle.SelectionForeColor = NegativeForeColor; } }
private void gridView_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is SpreadsheetGridRowHeaderCellElement) { StyleSelectedCell(e.CellElement as SpreadsheetGridRowHeaderCellElement); } else if (e.CellElement is GridHeaderCellElement) { StyleSelectedCell(e.CellElement as GridHeaderCellElement); } }
private void EnableCellEdit(CellFormattingEventArgs e, string affectedColumn, bool resetReadOnly = true) { e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.NumberOfColorsProperty, ValueResetFlags.Local); if (resetReadOnly && e.Row.Cells[affectedColumn] != null) { e.Row.Cells[affectedColumn].ReadOnly = false; } }
private void DisableCellEdit(CellFormattingEventArgs e, string affectedColumn) { e.CellElement.DrawFill = true; e.CellElement.BackColor = Color.LightGray; e.CellElement.NumberOfColors = 1; e.CellElement.ForeColor = Color.Gray; if (e.Row.Cells[affectedColumn] != null) { e.Row.Cells[affectedColumn].ReadOnly = true; } }
protected override void Grilla_CellFormatting(object sender, CellFormattingEventArgs e) { base.Grilla_CellFormatting(sender, e); if (e.Column.Name == "ColumnaEliminar") { var orden = e.Row.DataBoundItem as OrdenesPagoDto; if (orden != null) { e.CellElement.Enabled = orden.PuedeEliminar(); } } }
private void grdItems_CellFormatting(object sender, CellFormattingEventArgs e) { try { if (e.CellElement is GridCommandCellElement) { if (e.Column.Name.Equals("Edit")) { RadButtonElement bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.ImageAlignment = ContentAlignment.MiddleCenter; bte.Image = Resources.folder_view_16x16; bte.ToolTipText = @"Editar Planilla"; bte.AutoSize = true; } } if (e.Column.Name.Equals("Delete")) { RadButtonElement bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.ImageAlignment = ContentAlignment.MiddleCenter; bte.Image = Resources.delete1; bte.ToolTipText = @"Eliminar Planilla"; bte.AutoSize = true; } } if (e.Column.Name.Equals("Print")) { RadButtonElement bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.ImageAlignment = ContentAlignment.MiddleCenter; bte.Image = Resources.printer2_16x16; bte.ToolTipText = @"Imprimir Planilla"; bte.AutoSize = true; } } if (e.CellElement.RowInfo is GridViewNewRowInfo && e.CellElement.ColumnInfo is GridViewCommandColumn) { ((RadButtonElement)e.CellElement.Children[0]).Visibility = ElementVisibility.Hidden; } } } catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error al formatear el icono." + ex.Message); } }
void grdLister_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridHeaderCellElement) { // e.CellElement e.CellElement.BorderColor = _HeaderRowBorderColor; e.CellElement.BorderColor2 = _HeaderRowBorderColor; e.CellElement.BorderColor3 = _HeaderRowBorderColor; e.CellElement.BorderColor4 = _HeaderRowBorderColor; // e.CellElement.DrawBorder = false; e.CellElement.BackColor = _HeaderRowBackColor; e.CellElement.NumberOfColors = 1; e.CellElement.Font = newFont; e.CellElement.ForeColor = Color.White; e.CellElement.DrawFill = true; e.CellElement.BorderBoxStyle = BorderBoxStyle.SingleBorder; } else if (e.CellElement is GridFilterCellElement) { e.CellElement.Font = oldFont; e.CellElement.NumberOfColors = 1; e.CellElement.BackColor = Color.White; e.CellElement.RowElement.BackColor = Color.White; e.CellElement.RowElement.NumberOfColors = 1; e.CellElement.BorderColor = Color.DarkSlateBlue; e.CellElement.BorderColor2 = Color.DarkSlateBlue; e.CellElement.BorderColor3 = Color.DarkSlateBlue; e.CellElement.BorderColor4 = Color.DarkSlateBlue; e.CellElement.BorderBoxStyle = BorderBoxStyle.SingleBorder; } else if (e.CellElement is GridDataCellElement) { e.CellElement.ToolTipText = e.CellElement.Text; e.CellElement.BorderColor = Color.DarkSlateBlue; e.CellElement.BorderColor2 = Color.DarkSlateBlue; e.CellElement.BorderColor3 = Color.DarkSlateBlue; e.CellElement.BorderColor4 = Color.DarkSlateBlue; e.CellElement.BorderBoxStyle = BorderBoxStyle.SingleBorder; e.CellElement.ForeColor = Color.Black; e.CellElement.Font = oldFont; } }
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridCommandCellElement) { e.CellElement.Text = "Btn " + e.CellElement.RowInfo.Cells["Id"].Value; } else if (e.CellElement is GridDateTimeCellElement) { GridDateTimeCellElement dateTimeCell = e.CellElement as GridDateTimeCellElement; dateTimeCell.Text = String.Format("{0:ddd, MM/dd}", dateTimeCell.Value); } }
protected override void Grilla_CellFormatting(object sender, CellFormattingEventArgs e) { base.Grilla_CellFormatting(sender, e); if (e.Column.Name == "ColumnaEliminar") { var titulo = e.Row.DataBoundItem as TituloDto; if (titulo != null) { e.CellElement.Enabled = titulo.Activo; } } }
private void radGridViewTileConfig_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.IsCurrent) { e.CellElement.DrawFill = false; e.CellElement.DrawBorder = false; } else { e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, Telerik.WinControls.ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local); } }
private void grdAtivos_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.ColumnIndex != 0) { return; } RadButtonElement element = (RadButtonElement)e.CellElement.Children[0]; element.DisplayStyle = DisplayStyle.Image; element.Image = Resources.delete; element.ImageAlignment = ContentAlignment.MiddleCenter; }
private void rgAddons_CellFormatting(object sender, CellFormattingEventArgs e) { string columnName = e.Column.Name; object value = e.Row.Cells["PeriscopeStatus"].Value; if (!Convert.IsDBNull(value)) { if (columnName == "PeriscopeStatus") { e.CellElement.Text = CustomerDb.GetStandardLookupDescription(Convert.ToInt32(value)); } } }
void grdBookingType_ViewCellFormatting(object sender, CellFormattingEventArgs e) { try { if (e.CellElement is GridHeaderCellElement) { e.CellElement.Font = f; } } catch { } }
void grdOppList_CellFormatting(object sender, CellFormattingEventArgs e) { try { if (e.Column.Name.ToLower() == "threshold") { e.CellElement.Image = imgList.Images[0]; } } catch (Exception ex) { Telerik.WinControls.RadMessageBox.Show(this, ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, RadMessageIcon.Error, MessageBoxDefaultButton.Button1); } }
/// <summary> /// Ustawia komórki grida. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">CellFormattingEventArgs.</param> private void CarServicesCarGridView_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.Value != null) { if ((CarServicesCarGridView.Rows[e.RowIndex].DataBoundItem != null) && (CarServicesCarGridView.Columns[e.ColumnIndex].FieldName.Contains("."))) { e.CellElement.Value = PropertyBindingManager.BindProperty( CarServicesCarGridView.Rows[e.RowIndex].DataBoundItem, CarServicesCarGridView.Columns[e.ColumnIndex].FieldName ); } } }
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridSummaryCellElement) { e.CellElement.DrawBorder = true; e.CellElement.BorderBoxStyle = BorderBoxStyle.FourBorders; e.CellElement.BorderLeftWidth = 0; e.CellElement.BorderRightWidth = 0; e.CellElement.BorderBottomWidth = 0; e.CellElement.BorderTopWidth = 1; e.CellElement.BorderTopColor = Color.Black; e.CellElement.TextAlignment = ContentAlignment.MiddleLeft; } }
private void assetStatus_GridView_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.Value != null && e.ColumnIndex == 3) { int lineCount = e.CellElement.Value.ToString().Split(_separator, StringSplitOptions.RemoveEmptyEntries).Length; if (lineCount > 1) { int height = (lineCount + 1) * 18; assetStatus_GridView.ChildRows[e.RowIndex].Height = height; } e.CellElement.ToolTipText = e.CellElement.Text; } }
private void printQueue_GridView_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridCommandCellElement) { GridCommandCellElement buttonCell = e.CellElement as GridCommandCellElement; //Manually set the button size. If AutoSize is used, it will not size the button correctly. buttonCell.CommandButton.AutoSize = false; buttonCell.CommandButton.Size = new System.Drawing.Size(printQueue_GridView.Columns[buttonCell.ColumnIndex].Width - 8, printQueue_GridView.TableElement.RowHeight - 8); } //Configure grid lines for all cells ConfigureGridLines(e.CellElement, Color.LightGray); }
private void gridAgents_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridDataCellElement) { e.CellElement.ToolTipText = e.CellElement.Text; if (string.Equals(e.Column.FieldName, "stateDescription", StringComparison.Ordinal)) { e.CellElement.DrawImage = true; e.CellElement.DrawText = false; var row = ((DataRowView)e.Row.DataBoundItem).Row; if (!(bool)row["reachable"]) { e.CellElement.Image = ImageResources.AgentStateError; } else { switch ((AgentState)row["state"]) { case AgentState.Created: case AgentState.Idle: e.CellElement.Image = ImageResources.AgentStateIdle; break; case AgentState.Activating: case AgentState.Deactivating: e.CellElement.Image = ImageResources.AgentStateWaiting; break; case AgentState.Activated: e.CellElement.Image = ImageResources.AgentStateActivated; break; case AgentState.Disposed: case AgentState.Failed: e.CellElement.Image = ImageResources.AgentStateError; break; } } } else { e.CellElement.DrawImage = false; e.CellElement.DrawText = true; } } }
private void gridViewDecks_CellFormatting(object sender, CellFormattingEventArgs e) { Deck currentDeck = (Deck)e.CellElement.RowInfo.DataBoundItem; // Reset the color of the cell. e.CellElement.DrawFill = false; if (e.Column.Name != "Name") { return; } List <string> usedColours = new List <string>(); foreach (GridViewRowInfo t in gridViewDecks.Rows) { Deck parDeck = (Deck)t.DataBoundItem; if (currentDeck.DuplicateIndicatior != parDeck.DuplicateIndicatior || currentDeck.Source == parDeck.Source) { continue; } e.CellElement.DrawFill = true; e.CellElement.GradientStyle = GradientStyles.Linear; e.CellElement.BackColor2 = Color.White; e.CellElement.GradientAngle = 225; Color parBackColor = t.Cells["Name"].Style.BackColor; if (parBackColor.ToArgb().Equals(Color.FromArgb(105, 105, 105).ToArgb())) { KnownColor randomColorName = names.ElementAt(randomGen.Next(names.Count)); Color randomColor = Color.FromKnownColor(randomColorName); double a = 1 - (0.299 * randomColor.R + 0.587 * randomColor.G + 0.114 * randomColor.B) / 255; while (a < 0.3 || usedColours.Contains(randomColor.Name)) { randomColorName = names.ElementAt(randomGen.Next(names.Count)); randomColor = Color.FromKnownColor(randomColorName); a = 1 - (0.299 * randomColor.R + 0.587 * randomColor.G + 0.114 * randomColor.B) / 255; } parBackColor = randomColor; usedColours.Add(randomColor.Name); } e.CellElement.BackColor = parBackColor; e.Row.Cells["Name"].Style.BackColor = parBackColor; t.Cells["Name"].Style.BackColor = parBackColor; } }
private void dgvPendingOrders_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.ColumnInfo.FieldName == "CanStartPreparing") { e.CellElement.Font = new Font(e.CellElement.Font, FontStyle.Bold); if (e.CellElement.Value == "LISTO") { e.CellElement.ForeColor = Color.Green; } else if (e.CellElement.Value == "FALTA") { e.CellElement.ForeColor = Color.Red; } } }
private void radGridView2_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.ColumnInfo is GridViewCommandColumn) { RadButtonElement button = (RadButtonElement)e.CellElement.Children[0]; if (e.CellElement.BackColor == Color.Red) { button.Enabled = true; } else { button.Enabled = false; } } }
private void activityDetails_RadGridView_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.RowInfo is GridViewGroupRowInfo) { e.CellElement.DrawFill = true; e.CellElement.BackColor = Color.DarkGray; e.CellElement.GradientStyle = GradientStyles.Solid; } else { e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local); } }
private void OrderGV_CellFormatting(object sender, CellFormattingEventArgs e) { //GridCellElement cellElement = e.CellElement; //GridViewDataColumn ColumnItem = e.CellElement.ColumnInfo as GridViewDataColumn; //if (ColumnItem.OwnerTemplate is MasterGridViewTemplate) //{ // //布尔型居中 指定字段居中 // if (ColumnItem != null && // ColumnItem.DataType == typeof(bool) || CenterColumnName.Contains(ColumnItem.Name)) // { // e.CellElement.TextAlignment = ContentAlignment.MiddleCenter; // } //} }
//set an image(delete.gif) to a GridCommandCellElement public static void SetDeleteColumn(CellFormattingEventArgs e) { //Telerik.WinControls.UI. if (e.CellElement is GridCommandCellElement) { RadButtonElement bte = (RadButtonElement)e.CellElement.Children[0]; if (bte.Image == null) { bte.TextImageRelation = TextImageRelation.Overlay; bte.DisplayStyle = DisplayStyle.Image; bte.Image = RscImage.mini_error; bte.ImageAlignment = System.Drawing.ContentAlignment.MiddleCenter; } } }
private void grdData_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.ColumnIndex != 0) return; var customMessage = e.Row.DataBoundItem as CustomMessage; if (customMessage == null) return; switch (customMessage.Type.ToString()) { case "Info": e.CellElement.Value = "提示"; break; case "Error": e.CellElement.Value = "错误"; break; case "Warn": e.CellElement.Value = "警告"; break; } }
/// <summary> /// The draggable grid view_ row formatting. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void DraggableGridView_CellFormatting(object sender, CellFormattingEventArgs e) { e.CellElement.AllowDrag = true; e.CellElement.AllowDrop = true; }
private void gridview_CellFormatting(object sender, CellFormattingEventArgs e) { try { foreach (var subject in mDBManager.Subjects) { if (e.CellElement.Tag != null) { if (int.Parse(e.CellElement.Tag.ToString()) == subject.ID) { e.CellElement.BackColor = subject.Color; e.CellElement.Text = subject.ShortName; break; } } } e.CellElement.TextAlignment = ContentAlignment.BottomCenter; e.CellElement.NumberOfColors = 1; e.CellElement.DrawFill = true; e.CellElement.GradientStyle = GradientStyles.Solid; } catch { } }
private void gvSejarahDisposisi_ViewCellFormatting_1(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridHeaderCellElement) { Padding pad = new System.Windows.Forms.Padding(2); e.CellElement.Font = new System.Drawing.Font("Segoe UI", (float)9, FontStyle.Bold); e.CellElement.Padding = pad; e.CellElement.TextAlignment = ContentAlignment.MiddleLeft; } }
private void gvSejarahDisposisi_CellFormatting(object sender, CellFormattingEventArgs e) { }
private void radGridView2_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridHeaderCellElement) { e.CellElement.Font = boldFont; } if (e.Row is GridViewDataRowInfo) { e.CellElement.ToolTipText = e.CellElement.Text; } }
private void grdPatient_CellFormatting(object sender, CellFormattingEventArgs e) { Methods.setDeleteColumn(e); }
private void grdList_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.ColumnIndex == 0) { if (string.IsNullOrEmpty((string)grdList.Rows[e.RowIndex].Cells["statusNo"].Value)) return; string statusNo = grdList.Rows[e.RowIndex].Cells["statusNo"].Value.ToString(); e.CellElement.Image = ShayanResources.RscImage.mini_error; if (statusNo == SendStatus.Succesful.ToString()) { e.CellElement.Image = ShayanResources.RscImage.mini_tick; e.CellElement.ToolTipText = "با موفقیت فرستاده شد"; } else if (statusNo == SendStatus.Unsuccesful.ToString()) { e.CellElement.ToolTipText = "خطا در ارسال"; } else if (statusNo == SendStatus.NoBudjet.ToString()) { e.CellElement.ToolTipText = "اعتبار ناکافی"; } else if (statusNo == SendStatus.Unkown.ToString()) { e.CellElement.ToolTipText = "خطای نامشخص"; } } }
private void grvItems_CellFormatting(object sender, CellFormattingEventArgs e) { Methods.SetDeleteColumn(e); }
private void GridViewShowData_CellFormatting(object sender, CellFormattingEventArgs e) { if (!(e.CellElement.RowElement is GridTableHeaderRowElement)) { if (e.CellElement.ColumnInfo is GridViewCommandColumn) { GridViewCommandColumn column = (GridViewCommandColumn)e.CellElement.ColumnInfo; RadButtonElement button = (RadButtonElement)e.CellElement.Children[0]; if (column.Name == "Delete") { RadButtonElement element = (RadButtonElement)e.CellElement.Children[0]; element.DisplayStyle = DisplayStyle.Image; element.Image = Properties.Resources.Close; element.ImageAlignment = ContentAlignment.MiddleCenter; } } } }
private void GridTitulos_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.RowInfo.Group == null && e.CellElement is GridSummaryCellElement) { e.CellElement.ForeColor = Color.Black; e.CellElement.TextAlignment = ContentAlignment.MiddleLeft; e.CellElement.Font = new Font(FontFamily.GenericSansSerif, 12, FontStyle.Bold); } }
private void gvUser_CellFormatting(object sender, CellFormattingEventArgs e) { Padding pad = new System.Windows.Forms.Padding(3); e.CellElement.Padding = pad; }
private void ActivitiesGridView_CellFormatting(object sender, CellFormattingEventArgs e) { Font newFont = new Font("Times New Roman", 12f, FontStyle.Bold); if (e.CellElement.ColumnInfo.Name == "ActivityName") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } if (e.CellElement.ColumnInfo.Name == "ActivityDescription") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } if (e.CellElement.ColumnInfo.Name == "ActivityStartDate") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } // if (e.CellElement.ColumnInfo.Name == "ActivityEndDate") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } // if (e.CellElement.ColumnInfo.Name == "ActivityStatus") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } // if (e.CellElement.ColumnInfo.Name == "ActivityProgress") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } if (e.CellElement.ColumnInfo.Name == "ActivityStatus"){ string title = e.CellElement.RowInfo.Cells[6].Value.ToString(); if (title == "غير فعال") { e.CellElement.ForeColor = Color.Red; e.CellElement.Font = newFont; } else { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } } if (e.CellElement.ColumnInfo.Name == "ActivityTotalCost") { e.CellElement.ForeColor = Color.DarkSlateBlue; e.CellElement.Font = newFont; } }
private void gridViewPersons_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.ColumnInfo.Name == "columnClanColor") { e.CellElement.DrawFill = true; if (e.CellElement.RowInfo.Cells["columnClanColor"].Value != null) e.CellElement.BackColor = Color.FromKnownColor((KnownColor)e.CellElement.Value); } else { e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local); } }
private void gvOrders_CellFormatting(object sender, CellFormattingEventArgs e) { var order = e.Row.DataBoundItem as OrderDto; if (order != null) { if (e.CellElement.ColumnInfo.Name == GlobalConstants.BuildOrderColumnName) { e.CellElement.ColumnInfo.IsVisible = order.OrderStatusId == OrderStatus.PENDING; } if (e.CellElement.ColumnInfo.Name == GlobalConstants.CancelBuildedOrderColumnName) { e.CellElement.ColumnInfo.IsVisible = order.OrderStatusId == OrderStatus.IN_PROGESS; } if (e.CellElement.ColumnInfo.Name == GlobalConstants.FinishOrderColumnName) { e.CellElement.ColumnInfo.IsVisible = order.OrderStatusId == OrderStatus.IN_PROGESS; } if (e.CellElement.ColumnInfo.Name == GlobalConstants.SendOrderColumnName) { e.CellElement.ColumnInfo.IsVisible = order.OrderStatusId == OrderStatus.FINISHED; } } }
private void gvHistoryLoginUser_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridHeaderCellElement) { Padding pad = new System.Windows.Forms.Padding(2); e.CellElement.Font = new Font("Segoe UI", (float)9, FontStyle.Bold); e.CellElement.Padding = pad; e.CellElement.TextAlignment = ContentAlignment.MiddleLeft; } }
protected override void Grilla_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.Column.Name == "Eliminar") { var senia = e.Row.DataBoundItem as ProveedorSenia; if (senia != null) { e.CellElement.Enabled = senia.ImporteUsado.GetValueOrDefault() == 0; var commandCell = e.CellElement as GridCommandCellElement; if (commandCell != null) { commandCell.CommandButton.ToolTipText = Resources.TooltipAnulacionCompleta; } } } else if (e.Column.Name == "Anular") { var senia = e.Row.DataBoundItem as ProveedorSenia; if (senia != null) { e.CellElement.Enabled = senia.Importe != senia.ImporteUsado; var commandCell = e.CellElement as GridCommandCellElement; if (commandCell != null) { commandCell.CommandButton.ToolTipText = Resources.TooltipAnulacionParcial; } } } base.Grilla_CellFormatting(sender, e); }
private void CellFormatEvent(object sender, CellFormattingEventArgs e) { String ColumnName = e.Column.Name; Object Value = e.Row.Cells[ColumnName].Value; Console.WriteLine("Column: {0}\nValue: {1}\n\n", e.Column.Name, e.CellElement.Text); if (ColumnName == "Type") { e.CellElement.Text = object.Equals(Value, "D") ? "Debit" : "Credit"; } if (ColumnName == "Balance") { e.CellElement.Text = ((decimal)Value).ToString("₱# ##0.00"); } if (ColumnName == "ID") { e.CellElement.Text = String.Format("{0}", e.CellElement.RowIndex + 1); } }
private void rgv_ApproveHR_CellFormatting(object sender, CellFormattingEventArgs e) { if (!(e.CellElement.RowElement is GridTableHeaderRowElement)) { if (e.CellElement.ColumnInfo is GridViewCommandColumn) { GridViewCommandColumn column = (GridViewCommandColumn)e.CellElement.ColumnInfo; RadButtonElement button = (RadButtonElement)e.CellElement.Children[0]; if (column.Name == "ApproveButton") { RadButtonElement element = (RadButtonElement)e.CellElement.Children[0]; element.Text = "อนุมัติ"; element.TextAlignment = ContentAlignment.MiddleCenter; } } } }
//将ReadOnly的列背景色置灰 /// <summary> /// 将ReadOnly的列背景色置灰 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FastGridView_CellFormatting(object sender, CellFormattingEventArgs e) { if (!ChangeReadOnlyBackColor) return; var readOnlyColumnIndexs = new List<int>(); for (var i = 0; i < ColumnCount; i++) { if (Columns[i].ReadOnly) readOnlyColumnIndexs.Add(i); } if (!readOnlyColumnIndexs.Contains(e.ColumnIndex)) return; e.CellElement.DrawFill = true; e.CellElement.NumberOfColors = 1; e.CellElement.BackColor = Color.LightGray; }
private void Rgv_ReportAllLeaveCount_CellFormatting(object sender, CellFormattingEventArgs e) { if (!(e.CellElement.RowElement is GridTableHeaderRowElement)) { if (e.CellElement.ColumnInfo is GridViewCommandColumn) { GridViewCommandColumn column = (GridViewCommandColumn)e.CellElement.ColumnInfo; RadButtonElement button = (RadButtonElement)e.CellElement.Children[0]; if (column.Name == "DetaiButton") { RadButtonElement element = (RadButtonElement)e.CellElement.Children[0]; element.Text = "รายละเอียด"; element.TextAlignment = ContentAlignment.MiddleCenter; } } } }
private void gridVerificare_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.ColumnInfo is GridViewCommandColumn) { ((RadButtonElement)e.CellElement.Children[0]).Image = Properties.Resources.imgPlay16; ((RadButtonElement)e.CellElement.Children[0]).ImageAlignment = ContentAlignment.MiddleCenter; } }