Cita:
Iniciado por leochavez haci lo hise mire
Private Sub dgvsalud_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlSho wingEventArgs) Handles dgvsalud.EditingControlShowing
If TypeOf e.Control Is DataGridViewComboBoxEditingControl Then ' Validando si el control es de tipo combobox edit
If dgvsalud.CurrentCell.ColumnIndex = 0 Then ' Valida si el index es igual al combo primario en donde vas a realizar el filtro
Dim CellTextBox As DataGridViewComboBoxEditingControl = TryCast(e.Control, DataGridViewComboBoxEditingControl)
RemoveHandler CellTextBox.SelectionChangeCommitted, AddressOf CellTextBox_SelectionChangeCommited
AddHandler CellTextBox.SelectionChangeCommitted, AddressOf CellTextBox_SelectionChangeCommited
End If
End If
End Sub
Sub CellTextBox_SelectionChangeCommited(ByVal sender As Object, ByVal e As EventArgs)
Dim c As ComboBox = TryCast(sender, ComboBox)
Dim value As Object = c.SelectedValue
Dim Combo As DataGridViewComboBoxColumn = TryCast(dgvsalud.Columns(dgvsalud.CurrentCell.Colu mnIndex, DataGridViewComboBoxColumn)
dsc_eps.DataSource = lobjTipoSeguro.fcboseguros(value)
dsc_eps.ValueMember = "cod_tipo_seguro"
dsc_eps.DisplayMember = "dsc_tipo_seguro"
End Sub
Esta parte de aca
If dgvsalud.CurrentCell.ColumnIndex = 0
es importante tienes que ponerlo el indice de la columna "departamento" sino todas las columnas de tipo combo van a cambiar segun el codigo que he puesto