Código:
alguna idea de que estoy haciendo mal? Código vb:Ver original
Private Sub BtnOrdena_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOrdena.Click Dim col2 As String Dim col3 As String Dim col4 As String For i As Integer = 0 To GridInd.Rows.Count - 1 If GridInd.Rows(i).IsNewRow = True Then Exit For ' GridInd.Item(5, i).Value= If Len((GridInd.Item(2, i).Value)) = 1 Then col2 = ("0" & (GridInd.Item(2, i).Value)) Else col2 = (GridInd.Item(2, i).Value) End If If Len((GridInd.Item(3, i).Value)) = 1 Then col3 = ("0" & (GridInd.Item(3, i).Value)) Else col3 = (GridInd.Item(3, i).Value) End If If Len((GridInd.Item(4, i).Value)) = 1 Then col4 = ("0" & (GridInd.Item(4, i).Value)) Else col4 = (GridInd.Item(4, i).Value) End If GridInd.Item(5, i).Value = col2 & col3 & col4 Next GridInd.Sort(GridInd.Columns(5), ListSortDirection.Ascending) End Sub