Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/01/2010, 13:21
Avatar de eperedo
eperedo
 
Fecha de Ingreso: septiembre-2009
Ubicación: Perú
Mensajes: 654
Antigüedad: 14 años, 7 meses
Puntos: 16
Respuesta: Ayuda al buscar un dato repetido en un Datagridview

Podría resultarte usando Contains en la comparación, algo así:
Cita:
Iniciado por Sonsuke Ver Mensaje
Código:
'Contador
Private vldContador As Double = 0

Private Sub oTx_BuscaNombre_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles oTx_BuscaNombre.KeyPress
        Dim i As Double

        If e.KeyChar = ChrW(Keys.Enter) Then
            For i = vldContador To oGvDatosClase.RowCount - 1
                If Convert.ToString(oGvDatosClase.Rows(i).Cells("NOMBRE").Value).Contains(UCase(oTx_BuscaNombre.Text)) Then
                    oGvDatosClase.Rows(i).Selected = True
                    oGvDatosClase.Rows(i).Selected = i
                    vldContador = i + 1
                    Exit For
                End If

        'Para buscar otro dato
        If e.KeyChar = ChrW(Keys.Back) Or e.KeyChar = ChrW(Keys.Delete) Then
            vldContador = 0
        End If
    End Sub
Espero te sirva
__________________
Eduardo Peredo
Wigoin