Table of Contents

Class DataGridViewExComboBoxCell

Namespace
ExControls
Assembly
ExControls.dll

DataGridView cell with a combo box that can be drawn in the custom style with the state colors of ExComboBoxStyle like ExComboBox.

public class DataGridViewExComboBoxCell : DataGridViewComboBoxCell, ICloneable, IDisposable
Inheritance
DataGridViewExComboBoxCell
Implements
Inherited Members

Constructors

DataGridViewExComboBoxCell()

Initializes a new instance of the DataGridViewExComboBoxCell class in the default style.

public DataGridViewExComboBoxCell()

Properties

DefaultStyle

Default style of the Control

public bool DefaultStyle { get; set; }

Property Value

bool

DropDownBackColor

Color of the selected row in drop down menu

public Color DropDownBackColor { get; set; }

Property Value

Color

DropDownSelectedBackColor

Color of the selected row in drop down menu

public Color DropDownSelectedBackColor { get; set; }

Property Value

Color

EditType

Gets the type of the cell's hosted editing control.

public override Type EditType { get; }

Property Value

Type

The Type of the underlying editing control. This property always returns DataGridViewComboBoxEditingControl.

StyleDisabled

Disabled style of the Control (when control is not Enabled).

public ExComboBoxStyle StyleDisabled { get; set; }

Property Value

ExComboBoxStyle

StyleHighlight

Highlight style of the Control (when mouse is over control).

public ExComboBoxStyle StyleHighlight { get; set; }

Property Value

ExComboBoxStyle

StyleNormal

Normal style of the Control (when is inactive).

public ExComboBoxStyle StyleNormal { get; set; }

Property Value

ExComboBoxStyle

StyleSelected

Selected style of the Control (when control is selected).

public ExComboBoxStyle StyleSelected { get; set; }

Property Value

ExComboBoxStyle

Methods

Clone()

Creates an exact copy of this cell.

public override object Clone()

Returns

object

An object that represents the cloned DataGridViewComboBoxCell.

InitializeEditingControl(int, object?, DataGridViewCellStyle)

Attaches and initializes the hosted editing control.

public override void InitializeEditingControl(int rowIndex, object? initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)

Parameters

rowIndex int

The index of the cell's parent row.

initialFormattedValue object

The initial value to be displayed in the control.

dataGridViewCellStyle DataGridViewCellStyle

A DataGridViewCellStyle that determines the appearance of the hosted control.

Paint(Graphics, Rectangle, Rectangle, int, DataGridViewElementStates, object?, object?, string?, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts)

Paints the current DataGridViewComboBoxCell.

protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object? value, object? formattedValue, string? errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)

Parameters

graphics Graphics

The Graphics used to paint the cell.

clipBounds Rectangle

A Rectangle that represents the area of the DataGridView that needs to be repainted.

cellBounds Rectangle

A Rectangle that contains the bounds of the cell that is being painted.

rowIndex int

The row index of the cell that is being painted.

elementState DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values that specifies the state of the cell.

value object

The data of the cell that is being painted.

formattedValue object

The formatted data of the cell that is being painted.

errorText string

An error message that is associated with the cell.

cellStyle DataGridViewCellStyle

A DataGridViewCellStyle that contains formatting and style information about the cell.

advancedBorderStyle DataGridViewAdvancedBorderStyle

A DataGridViewAdvancedBorderStyle that contains border styles for the cell that is being painted.

paintParts DataGridViewPaintParts

A bitwise combination of the DataGridViewPaintParts values that specifies which parts of the cell need to be painted.