Exemple #1
0
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);

            args.DrawCenteredText(string.Format("{0:d}", value));
        }
Exemple #2
0
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);

            args.DrawCenteredText(Convert.ToString(value));
        }
Exemple #3
0
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);

            const int size = 35;
            var       rect = args.ClipRectangle;

            rect.Right -= size;
            args.DrawCenteredText(value.ToHex(ShowAlpha), rect: rect);

            rect      = args.ClipRectangle;
            rect.Left = rect.Right - size;
            args.Graphics.FillRectangle(value, rect);
        }