Ver Mensaje Individual
  #7 (permalink)  
Antiguo 15/03/2011, 08:08
Avatar de Aquaventus
Aquaventus
 
Fecha de Ingreso: junio-2010
Ubicación: Lima-Peru , En el alba de la naturaleza
Mensajes: 2.105
Antigüedad: 13 años, 10 meses
Puntos: 267
Respuesta: Datos duplicados en datagrid vb.net

Pruebalo de esta manera...

Código vb.net:
Ver original
  1. Private Sub grilla_menu_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grilla_menu.CellContentDoubleClick
  2.         Dim k As String
  3.         Dim tota, toot As Integer
  4.        
  5.         ' Se agrega el item seleccionado a la grilla de destino
  6.         Dim existe = False
  7.  
  8.         For Each row As DataGridViewRow In grilla_dia.Rows
  9.             If Convert.ToString(row.Cells("Nombre Menu").Value).Equals(grilla_menu.CurrentRow.Cells("Nombre Menu").Value) Then
  10.                 existe = True
  11.             End If
  12.             If (existe = True) Then
  13.                     MsgBox("Éste menú ya fué agregado", MsgBoxStyle.OkOnly, "INFORMACIÓN")
  14.             Else
  15. grilla_dia.Rows.Add(grilla_menu.CurrentRow)
  16.  
  17.             toot = grilla_menu.CurrentRow.Cells("Valor").Value
  18.             tota = TextBox1.Text
  19.  
  20.             k = (toot + tota)
  21.  
  22.             TextBox1.Text = k
  23.                 End If
  24.            
  25.         Next
  26.        
  27.     End Sub
__________________
Internet es tener todo el conocimiento global a tu disposición.
Desarrollo de Software - Ejemplos .Net