You can handle the OnIndexChanged event of the ComboBox. Therefore you need to add your personal eventhandler in the EditingControlShowing event of the DGV. Then when something changes, you function gets called.
I think there is an example in the FAQ in this forum.
Code Snippet
private
: System::Void dataGridViewComponents_EditingControlShowing(System::Object^ sender, System::Windows::Forms::DataGridViewEditingControlShowingEventArgs^ e) {
if ( dataGridViewComponents->Columns[ dataGridViewComponents->CurrentCell->ColumnIndex ]->Name->Equals( "Component" ) ) {
ComboBox ^cb =
dynamic_cast<ComboBox^>(e->Control);
if (cb!=nullptr) {
cb->SelectedIndexChanged -=
gcnew System::EventHandler(this, &ApplicationForm::ComboBoxComponent_SelectedIndexChanged);
cb->SelectedIndexChanged +=
gcnew System::EventHandler(this, &ApplicationForm::ComboBoxComponent_SelectedIndexChanged);
}
}
}
Bernd