示例#1
0
        protected override void PaintCellContents(Graphics g, Rectangle cellBounds, DataGridColumnStyle column, Brush backBr, Brush foreBrush, bool alignToRight)
        {
            CurrencyManager listManager  = base.DataGrid.ListManager;
            string          str          = string.Empty;
            Rectangle       visualBounds = cellBounds;
            object          obj2         = base.DataGrid.ListManager[base.number];

            if (obj2 is IDataErrorInfo)
            {
                str = ((IDataErrorInfo)obj2)[column.PropertyDescriptor.Name];
            }
            if (!string.IsNullOrEmpty(str))
            {
                Rectangle rectangle2;
                int       num;
                Bitmap    errorBitmap = base.GetErrorBitmap();
                lock (errorBitmap)
                {
                    rectangle2 = base.PaintIcon(g, visualBounds, true, alignToRight, errorBitmap, backBr);
                }
                if (alignToRight)
                {
                    visualBounds.Width -= rectangle2.Width + 3;
                }
                else
                {
                    visualBounds.X += rectangle2.Width + 3;
                }
                DataGrid dataGrid = base.DataGrid;
                dataGrid.ToolTipId = (num = dataGrid.ToolTipId) + 1;
                base.DataGrid.ToolTipProvider.AddToolTip(str, (IntPtr)num, rectangle2);
            }
            column.Paint(g, visualBounds, listManager, base.RowNumber, backBr, foreBrush, alignToRight);
        }
 protected override void PaintCellContents(Graphics g, Rectangle cellBounds, DataGridColumnStyle column, Brush backBr, Brush foreBrush, bool alignToRight)
 {
     if (this.DataBound)
     {
         CurrencyManager listManager = base.DataGrid.ListManager;
         column.Paint(g, cellBounds, listManager, base.RowNumber, alignToRight);
     }
     else
     {
         base.PaintCellContents(g, cellBounds, column, backBr, foreBrush, alignToRight);
     }
 }
示例#3
0
        protected override void PaintCellContents(Graphics g, Rectangle cellBounds, DataGridColumnStyle column,
                                                  Brush backBr, Brush foreBrush, bool alignToRight)
        {
            CurrencyManager listManager = DataGrid.ListManager;

            // painting the error..
            //
            string    errString = string.Empty;
            Rectangle bounds    = cellBounds;
            object    errInfo   = DataGrid.ListManager[number];

            if (errInfo is IDataErrorInfo)
            {
                errString = ((IDataErrorInfo)errInfo)[column.PropertyDescriptor.Name];
            }

            if (!string.IsNullOrEmpty(errString))
            {
                Bitmap    bmp = GetErrorBitmap();
                Rectangle errRect;
                lock (bmp)
                {
                    errRect = PaintIcon(g, bounds, true, alignToRight, bmp, backBr);
                }
                // paint the errors correctly when RTL = true
                if (alignToRight)
                {
                    bounds.Width -= errRect.Width + xOffset;
                }
                else
                {
                    bounds.X += errRect.Width + xOffset;
                }

                DataGrid.ToolTipProvider.AddToolTip(errString, (IntPtr)(DataGrid.ToolTipId++), errRect);
            }

            column.Paint(g, bounds, listManager, RowNumber, backBr, foreBrush, alignToRight);
        }
示例#4
0
 protected override void PaintCellContents(Graphics g, Rectangle cellBounds, DataGridColumnStyle column,
                                           Brush backBr, Brush foreBrush, bool alignToRight) {
     if (DataBound) {
         CurrencyManager listManager = DataGrid.ListManager;
         column.Paint(g, cellBounds, listManager, this.RowNumber, alignToRight);
     }
     else {
         base.PaintCellContents(g, cellBounds, column, backBr, foreBrush, alignToRight);
     }
 }
 protected override void PaintCellContents(Graphics g, Rectangle cellBounds, DataGridColumnStyle column, Brush backBr, Brush foreBrush, bool alignToRight)
 {
     CurrencyManager listManager = base.DataGrid.ListManager;
     string str = string.Empty;
     Rectangle visualBounds = cellBounds;
     object obj2 = base.DataGrid.ListManager[base.number];
     if (obj2 is IDataErrorInfo)
     {
         str = ((IDataErrorInfo) obj2)[column.PropertyDescriptor.Name];
     }
     if (!string.IsNullOrEmpty(str))
     {
         Rectangle rectangle2;
         int num;
         Bitmap errorBitmap = base.GetErrorBitmap();
         lock (errorBitmap)
         {
             rectangle2 = base.PaintIcon(g, visualBounds, true, alignToRight, errorBitmap, backBr);
         }
         if (alignToRight)
         {
             visualBounds.Width -= rectangle2.Width + 3;
         }
         else
         {
             visualBounds.X += rectangle2.Width + 3;
         }
         DataGrid dataGrid = base.DataGrid;
         dataGrid.ToolTipId = (num = dataGrid.ToolTipId) + 1;
         base.DataGrid.ToolTipProvider.AddToolTip(str, (IntPtr) num, rectangle2);
     }
     column.Paint(g, visualBounds, listManager, base.RowNumber, backBr, foreBrush, alignToRight);
 }
        protected override void PaintCellContents(Graphics g, Rectangle cellBounds, DataGridColumnStyle column,
                                                  Brush backBr, Brush foreBrush, bool alignToRight) {
            CurrencyManager listManager = DataGrid.ListManager;

            // painting the error..
            //
            string errString = String.Empty;
            Rectangle bounds = cellBounds;
            object errInfo = DataGrid.ListManager[this.number];
            if (errInfo is IDataErrorInfo)
                errString = ((IDataErrorInfo) errInfo)[column.PropertyDescriptor.Name];

            if (!String.IsNullOrEmpty(errString)) {
                Bitmap bmp = GetErrorBitmap();
                Rectangle errRect;
                lock (bmp) {
                    errRect = PaintIcon(g, bounds, true, alignToRight, bmp, backBr);
                }
                // paint the errors correctly when RTL = true
                if (alignToRight)
                    bounds.Width -= errRect.Width + xOffset;
                else
                    bounds.X += errRect.Width + xOffset;
                DataGrid.ToolTipProvider.AddToolTip(errString, (IntPtr)(DataGrid.ToolTipId ++), errRect);
            }

            column.Paint(g, bounds, listManager, this.RowNumber, backBr, foreBrush, alignToRight);
        }