Public Class DataGridComboBoxColumn Public Event SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Private Sub ColumnComboBox_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles ColumnComboBox.SelectedValueChanged RaiseEvent SelectedValueChanged(sender, e) End Sub End ClassNow when the Selected value of the comboBox changes, I raise the SelectedValueChanged event.
Private Sub cboDataGrid_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles cboDataGrid.SelectedValueChanged '----------------------------------------------------------- ' When the values changes in the combo box for priority, we ' populate the current datarow with that value '----------------------------------------------------------- Try Dim strPriorityID As String Dim cm As CurrencyManager = _ CType(Me.dgFileInfo.BindingContext(dgFileInfo.DataSource), CurrencyManager) If Not (Me.cboDataGrid.ColumnComboBox.SelectedValue Is Nothing) Then strPriorityID = Me.cboDataGrid.ColumnComboBox.SelectedValue.ToString Dim pk As New Guid(strPriorityID) Dim row As DataRow = CType(cm.Current, DataRowView).Row row("fk_PriorityID") = pk End If Catch ex As Exception m_Error.ErrorMessage(ex.Message, "frmInformation::cboDataGrid_SelectedValueChanged") End Try End SubI am not sure if this is the "correct" way to do this, but at least now I can save information that is entered using the combobox.