Ver Mensaje Individual
  #17 (permalink)  
Antiguo 31/07/2012, 16:38
leochavez
 
Fecha de Ingreso: febrero-2012
Ubicación: San juan de luriguashington
Mensajes: 39
Antigüedad: 12 años, 9 meses
Puntos: 2
Respuesta: filtrar combox dentro de datagridview vb net

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