DataGridColumnStyle.Paint Method

Definition

When overridden in a derived class, paints the column in a DataGrid control.

Overloads

Paint(Graphics, Rectangle, CurrencyManager, Int32)

Paints the DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, and row number.

Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean)

When overridden in a derived class, paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, and alignment.

Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean)

Paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, background color, foreground color, and alignment.

Paint(Graphics, Rectangle, CurrencyManager, Int32)

Paints the DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, and row number.

C#
protected internal abstract void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum);

Parameters

g
Graphics

The Graphics to draw to.

bounds
Rectangle

The bounding Rectangle to paint into.

source
CurrencyManager

The CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

The number of the row in the underlying data being referred to.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10

Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean)

When overridden in a derived class, paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, and alignment.

C#
protected internal abstract void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, bool alignToRight);

Parameters

g
Graphics

The Graphics to draw to.

bounds
Rectangle

The bounding Rectangle to paint into.

source
CurrencyManager

The CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

The number of the row in the underlying data being referred to.

alignToRight
Boolean

A value indicating whether to align the column's content to the right. true if the content should be aligned to the right; otherwise false.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10

Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean)

Paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, background color, foreground color, and alignment.

C#
protected internal virtual void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight);

Parameters

g
Graphics

The Graphics to draw to.

bounds
Rectangle

The bounding Rectangle to paint into.

source
CurrencyManager

The CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

The number of the row in the underlying data table being referred to.

backBrush
Brush

A Brush used to paint the background color.

foreBrush
Brush

A Color used to paint the foreground color.

alignToRight
Boolean

A value indicating whether to align the content to the right. true if the content is aligned to the right, otherwise, false.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10