private void MainGrid_CellFormatting(object sender, GridCellFormatEventArgs e) { var item = e.Item as LogModel; var settings = ViewModel.GetGridHighlightSettings(); if (Eto.Platform.Instance.IsMac) { if (_selectionChanging && e.Item == ViewModel.SelectedLine) { e.BackgroundColor = SystemColors.Highlight; e.ForegroundColor = SystemColors.HighlightText; return; } } if (Eto.Platform.Instance.IsWpf) { e.KeepHighlightWpf = true; } foreach (var colorTextItem in settings.GroupBy(m => m.RowQueryText).Select(m => m.First())) { if (colorTextItem.RowQueryText == string.Empty) { continue; } if (item.Line.Contains(colorTextItem.RowQueryText)) { e.BackgroundColor = colorTextItem.BackgroundColor; e.ForegroundColor = colorTextItem.ForegroundColor; } } }
private void grid_CellFormatting(object sender, GridCellFormatEventArgs e) { var col = (MyGridColumn)e.Column; var cellData = col.CellBinding.GetValue(e.Item); e.BackgroundColor = cellData.Color; }
private void MainGrid_CellFormatting(object sender, GridCellFormatEventArgs e) { if (e.Column == ColorColumn) { var item = e.Item as HighlightConfig; e.ForegroundColor = item.ForegroundColor; e.BackgroundColor = item.BackgroundColor; e.Font = new Font(SystemFont.TitleBar, 12); } }
private void fileView_CellFormatting(object sender, GridCellFormatEventArgs e) { if (e.Item == null) { return; } var element = (FileElement)e.Item; var isChanged = element.ArchiveFileInfo.ContentChanged || _stateInfo.ArchiveChildren.Where(x => x.StateChanged).Any(x => x.FilePath == element.ArchiveFileInfo.FilePath); e.ForegroundColor = isChanged ? ColorChangedState : ColorDefaultState; }
private void folderView_CellFormatting(object sender, GridCellFormatEventArgs e) { if (e.Item == null) { return; } var gridItem = (TreeGridItem)e.Item; var path = GetAbsolutePath(gridItem); e.ForegroundColor = _changedDirectories.Contains(path) ? ColorChangedState : ColorDefaultState; }
// Styling - set tree grid items to be bold if they or any children are selected void _OnFormatCell(object sender, GridCellFormatEventArgs e) { switch (e.Column.HeaderText) { case TagTypeLabel: var checkItem = e.Item as OSMTreeGridItem; var isSelectedOrHasChildSelected = false; if (checkItem.IsSelected()) { isSelectedOrHasChildSelected = true; } else if (checkItem.Children.Count > 0) { foreach (OSMTreeGridItem child in checkItem.Children) { if (child.IsSelected()) { isSelectedOrHasChildSelected = true; break; } } } if (isSelectedOrHasChildSelected) { e.Font = new Font(SystemFont.Bold); } else { e.Font = new Font(SystemFont.Default); } break; case TagWikiLabel: e.ForegroundColor = new ColorHSL(230f, 1.0f, 0.5f); break; case TagKVLabel: e.ForegroundColor = new ColorHSL(0f, 0f, 0.33f); e.Font = new Font(FontFamilies.Sans, 8.0f, FontStyle.None); break; case "Description": e.Font = new Font(FontFamilies.Sans, 8.0f, FontStyle.Italic); break; } }
void PropertyGridView_CellFormatting(object sender, GridCellFormatEventArgs e) { PropertyPOCO poco = e.Item as PropertyPOCO; if (poco != null) { if (poco.Group) { if (e.Font != null) { e.Font = new Font(e.Font.FamilyName, e.Font.Size, FontStyle.Bold); } e.BackgroundColor = Colors.LightGrey; if (e.Column.DataCell.GetType() == typeof(PropertyCustomCheckCell)) { PropertyCustomCheckCell cell = e.Column.DataCell as PropertyCustomCheckCell; if (cell != null) { CheckBox checkBox = cell.checkBox as CheckBox; if (checkBox != null) { checkBox.Visible = false; } } } } else { if (e.Font != null) { e.Font = new Font(e.Font.FamilyName, e.Font.Size, FontStyle.None); } if (e.Column.DataCell.GetType() == typeof(PropertyCustomCheckCell)) { PropertyCustomCheckCell cell = e.Column.DataCell as PropertyCustomCheckCell; if (cell != null) { CheckBox checkBox = cell.checkBox as CheckBox; if (checkBox != null) { checkBox.Visible = true; } } } } } }
private void grid_CellFormatting(object sender, GridCellFormatEventArgs e) { try { var col = (CommonalityGridColumn)e.Column; var cellData = col.CellBinding.GetValue(e.Item); // Can get a crash here with rapid resize due to grid view lagging display because cellData can be null if (cellData != null) { e.BackgroundColor = cellData.CellColor; e.ForegroundColor = inverseColor(e.BackgroundColor); } } catch (Exception) { } }
void PropertyGridView_CellFormatting(object sender, GridCellFormatEventArgs e) { PropertyPOCO poco = e.Item as PropertyPOCO; if (poco != null) { if (poco.Group) { if (e.Font != null) { e.Font = new Font(e.Font.FamilyName, e.Font.Size, FontStyle.Bold); } e.BackgroundColor = Colors.LightGrey; } else { if (e.Font != null) { e.Font = new Font(e.Font.FamilyName, e.Font.Size, FontStyle.None); } } } }
public void OnCellFormatting(GridCellFormatEventArgs args) { Callback.OnCellFormatting(Widget, args); }
public void OnCellFormatting(GridCellFormatEventArgs args) { Widget.OnCellFormatting(args); }
public void Format(GridCellFormatEventArgs args) { Source.OnCellFormatting(args); }
/// <summary> /// Raises the cell formatting event. /// </summary> public void OnCellFormatting(Grid widget, GridCellFormatEventArgs e) { using (widget.Platform.Context) widget.OnCellFormatting(e); }