DataGridViewComboBoxCell::InitializeEditingControl Method (Int32, Object^, DataGridViewCellStyle^)
Attaches and initializes the hosted editing control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: virtual void InitializeEditingControl( int rowIndex, Object^ initialFormattedValue, DataGridViewCellStyle^ dataGridViewCellStyle ) override
Parameters
- rowIndex
-
Type:
System::Int32
The index of the cell's parent row.
- initialFormattedValue
-
Type:
System::Object^
The initial value to be displayed in the control.
- dataGridViewCellStyle
-
Type:
System.Windows.Forms::DataGridViewCellStyle^
A DataGridViewCellStyle that determines the appearance of the hosted control.
The InitializeEditingControl method initializes the hosted ComboBox control as described in the base DataGridViewCell::InitializeEditingControl method. In addition, for every invocation, InitializeEditingControl does the following:
Sets the visual properties of the hosted ComboBox control, such as MaxDropDownItems, DropDownWidth, and FlatStyle, to match the corresponding properties of the current cell.
Sets the data-bound properties of the hosted ComboBox control, such as DataSource, DisplayMember, and ValueMember, to match the corresponding properties of the current cell.
Reinitializes the Items property of the hosted ComboBox control.
This method also adjusts the cell's dimensions to accommodate the hosted ComboBox control.
Available since 2.0