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);
        }
Beispiel #3
0
        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 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);
        }
Beispiel #5
0
        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    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);
        }