public virtual IFastGridCell GetColumnFilter(IFastGridView view, int column) { _requestedColumn = null; _requestedRow = null; _requestedColumnFilter = column; return(this); }
public override IFastGridCell GetCell(IFastGridView view, int row, int column) { if ((row + column) % 4 == 0) { return(new FastGridCellImpl { SetBlocks = new[] { new FastGridBlockImpl { IsItalic = true, FontColor = Colors.Gray, TextData = "(NULL)", } }, Decoration = CellDecoration.StrikeOutHorizontal, DecorationColor = Colors.Red, }); } var impl = new FastGridCellImpl(); impl.AddTextBlock(GetCellText(row, column)); var btn = impl.AddImageBlock("/Images/foreign_keysmall.png"); btn.MouseHoverBehaviour = MouseHoverBehaviours.HideWhenMouseOut; btn.CommandParameter = "TEST"; impl.RightAlignBlockCount = 1; return(impl); }
public override IFastGridCell GetColumnHeader(IFastGridView view, int column) { string image = null; if (column == 0) { image = "/Images/primary_keysmall.png"; } if (column == 2) { image = "/Images/foreign_keysmall.png"; } var res = new FastGridCellImpl(); if (image != null) { res.Blocks.Add(new FastGridBlockImpl { BlockType = FastGridBlockType.Image, ImageWidth = 16, ImageHeight = 16, ImageSource = image, }); } res.Blocks.Add(new FastGridBlockImpl { IsBold = true, TextData = String.Format("Column {0}", column), }); return(res); }
public override IFastGridCell GetCell(IFastGridView view, int row, int column) { var cell = new FastGridCellImpl(); switch (column) { case 2: var lines = new List <string>(); for (int i = 0; i <= row % 5; i++) { lines.Add(String.Format("Line {0}", i)); } if (view.FlexibleRows) { cell.AddTextBlock(String.Join("\n", lines)); } else { cell.AddTextBlock(String.Format("({0} lines)", lines.Count)).FontColor = Colors.Gray; cell.ToolTipText = String.Join("\n", lines); } return(cell); case 3: cell.AddTextBlock(_longText); cell.ToolTipText = _longText; cell.ToolTipVisibility = TooltipVisibilityMode.OnlyWhenTrimmed; return(cell); default: return(base.GetCell(view, row, column)); } }
public IFastGridCell GetCell(IFastGridView view, int row, int column, bool direct) { toolTipText = GetCellText(row, column, direct); var cell = base.GetCell(view, row, column) as SheetGridModel; if (cell == null) { return(cell); } ExcelCell excelCell; var status = ExcelCellStatus.None; if (TryGetCell(row, column, out excelCell, direct)) { //do nothing. } if (excelCell != null) { status = excelCell.Status; } cell.backgroundColor = null; cell.backgroundColor = GetColor(status) ?? cell.backgroundColor; return(cell); }
public virtual IFastGridCell GetRowHeader(IFastGridView view, int row) { _requestedRow = row; _requestedColumn = null; _requestedColumnFilter = null; return(this); }
public override void HandleCommand(IFastGridView view, FastGridCellAddress address, object commandParameter, ref bool handled) { base.HandleCommand(view, address, commandParameter, ref handled); if (commandParameter is string) { MessageBox.Show(commandParameter.ToString()); } }
public override IFastGridCell GetCell(IFastGridView view, int row, int column) { var cell = new FastGridCellImpl(); var text = cell.AddTextBlock(_rows[row][column]); cell.BackgroundColor = GetBackgroudColor(row, column); return(cell); }
public override IFastGridCell GetGridHeader(IFastGridView view) { var impl = new FastGridCellImpl(); var btn = impl.AddImageBlock(view.IsTransposed ? "/Images/flip_horizontal_small.png" : "/Images/flip_vertical_small.png"); btn.CommandParameter = FastWpfGrid.FastGridControl.ToggleTransposedCommand; btn.ToolTip = "Swap rows and columns"; impl.AddImageBlock("/Images/foreign_keysmall.png").CommandParameter = "FK"; impl.AddImageBlock("/Images/primary_keysmall.png").CommandParameter = "PK"; return(impl); }
public override IFastGridCell GetColumnHeader(IFastGridView view, int column) { var header = base.GetColumnHeader(view, column) as DiffGridModel; if (header == null) { return(header); } header.backgroundColor = App.Instance.Setting.ColumnHeaderColor; return(header); }
public override IFastGridCell GetRowHeader(IFastGridView view, int row) { var header = base.GetRowHeader(view, row) as SheetGridModel; if (header == null) { return(header); } header.backgroundColor = App.Instance.Setting.RowHeaderColor; return(header); }
public override IFastGridCell GetColumnHeader(IFastGridView view, int column) { var sortMethod = _isSortAscMap.GetValueOrDefault(column); string image = !sortMethod.HasValue ? "/Images/flip_vertical_small.png" : sortMethod.Value ? "/Images/flip_horizontal_small.png" : "/Images/flip_transform_small.png"; string sortCommand = !sortMethod.HasValue ? null : sortMethod.Value ? "Asc" : "Desc"; var cell = new FastGridCellImpl(); cell.AddTextBlock(_dataTable.Columns[column].ColumnName).IsBold = true; var btn = cell.AddImageBlock(image); btn.CommandParameter = ""; btn.MouseHoverBehaviour = MouseHoverBehaviours.ShowAllWhenMouseOut; return(cell); }
public override IFastGridCell GetColumnHeader(IFastGridView view, int column) { string image = null; if (column == 0) { image = "/Images/primary_keysmall.png"; } if (column == 2) { image = "/Images/foreign_keysmall.png"; } var res = new FastGridCellImpl(); if (image != null) { res.Blocks.Add(new FastGridBlockImpl { BlockType = FastGridBlockType.Image, ImageWidth = 16, ImageHeight = 16, ImageSource = image, }); } res.Blocks.Add(new FastGridBlockImpl { IsBold = true, TextData = String.Format("Column {0}", column), }); var btn = res.AddImageBlock("/Images/foreign_keysmall.png"); btn.MouseHoverBehaviour = MouseHoverBehaviours.HideWhenMouseOut; btn.CommandParameter = "TEST"; return(res); }
public IFastGridCell GetCell(IFastGridView view, int row, int column, bool direct) { toolTipText = GetCellText(row, column, direct); var cell = base.GetCell(view, row, column) as DiffGridModel; if (cell == null) { return(cell); } ExcelCellDiff cellDiff; var status = ExcelCellStatus.None; if (TryGetCellDiff(row, column, out cellDiff, direct)) { status = cellDiff.Status; if (status == ExcelCellStatus.Added && DiffType == DiffType.Source) { status = ExcelCellStatus.Removed; } else if (status == ExcelCellStatus.Removed && DiffType == DiffType.Source) { status = ExcelCellStatus.Added; } } cell.backgroundColor = null; if (App.Instance.Setting.ColorModifiedRow && IsModifiedRow(row, true)) { cell.backgroundColor = App.Instance.Setting.ModifiedRowColor; } cell.backgroundColor = GetColor(status) ?? cell.backgroundColor; return(cell); }
public override void HandleCommand(IFastGridView view, FastGridCellAddress address, object commandParameter, ref bool handled) { if (address.IsColumnHeader && address.Column.HasValue) { var column = address.Column.Value; var currSortMethod = _isSortAscMap.GetValueOrDefault(column); _isSortAscMap.Clear(); if (currSortMethod == true) { _rows = _rows.OrderByDescending(x => x[column]).ToList(); _isSortAscMap[column] = false; } else { _rows = _rows.OrderBy(x => x[column]).ToList(); _isSortAscMap[column] = true; } InvalidateAll(); handled = true; } }
public virtual void HandleCommand(IFastGridView view, FastGridCellAddress address, object commandParameter, ref bool handled) { }
public virtual void DetachView(IFastGridView view) { _grids.Remove(view); }
public virtual void AttachView(IFastGridView view) { _grids.Add(view); }
public virtual IFastGridCell GetGridHeader(IFastGridView view) { return(new FastGridCellImpl()); }
public virtual IFastGridCell GetCell(IFastGridView view, int row, int column) { _requestedRow = row; _requestedColumn = column; return(this); }
public virtual void HandleSelectionCommand(IFastGridView view, string command) { }
public override void HandleCommand(IFastGridView view, FastGridCellAddress address, object commandParameter, ref bool handled) { base.HandleCommand(view, address, commandParameter, ref handled); }
public override void HandleSelectionCommand(IFastGridView view, string command) { MessageBox.Show(command); }
public override IFastGridCell GetCell(IFastGridView view, int row, int column) { return(GetCell(view, row, column, false)); }
/// <summary> /// Return the collection of default column width overrides. /// </summary> public override Dictionary <int, int> GetColumnWidthOverrides(IFastGridView view) { return(ColumnWidthOverrides); }
public virtual HashSet <int> GetHiddenRows(IFastGridView view) { return(_hiddenRows); }
public override IFastGridCell GetCell(IFastGridView view, int row, int column) { return(base.GetCell(view, row, column)); }
public virtual HashSet <int> GetFrozenRows(IFastGridView view) { return(_frozenRows); }
public virtual Dictionary <int, int> GetColumnWidthOverrides(IFastGridView view) { return(_columnWidthOverrides); }