Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/09/2012, 10:19
Avatar de Dradi7
Dradi7
 
Fecha de Ingreso: junio-2008
Ubicación: Peru - Lima
Mensajes: 1.518
Antigüedad: 15 años, 10 meses
Puntos: 220
Respuesta: Concatenar cerosa la izquierda en datagridview

Bueno para esto agrega otra variable mira como debe quedar tu codigo

Código vb:
Ver original
  1. Private Sub BtnOrdena_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOrdena.Click
  2.         Dim col2 As String
  3.         Dim col3 As String
  4.         Dim col4 As String
  5.         Dim con as String = ""
  6.         For i As Integer = 0 To GridInd.Rows.Count - 1
  7.  
  8.             If GridInd.Rows(i).IsNewRow = True Then Exit For
  9.            
  10.             If Len((GridInd.Item(2, i).Value)) = 1 Then
  11.                 col2 = ("0" & (GridInd.Item(2, i).Value))
  12.             Else
  13.                 col2 = (GridInd.Item(2, i).Value)
  14.             End If
  15.  
  16.  
  17.             If Len((GridInd.Item(3, i).Value)) = 1 Then
  18.                 col3 = ("0" & (GridInd.Item(3, i).Value))
  19.             Else
  20.                 col3 = (GridInd.Item(3, i).Value)
  21.             End If
  22.  
  23.             If Len((GridInd.Item(4, i).Value)) = 1 Then
  24.                 col4 = ("0" & (GridInd.Item(4, i).Value))
  25.             Else
  26.                 col4 = (GridInd.Item(4, i).Value)
  27.             End If
  28.            
  29.            ' PRUEBA CON ESTO HABER
  30.           con = col2 & col3 & col4
  31.  
  32.             GridInd.Item(5, i).Value = con
  33.         Next
  34.         GridInd.Sort(GridInd.Columns(5), ListSortDirection.Ascending)
  35.    
  36.     End Sub
__________________
La clave de todo triunfador es eliminar todas sus excusas y sus limitaciones