Beispiel #1
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 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)
        {
            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);
        }