Visual Basic.NET - datagridview

 
Vista:
sin imagen de perfil
Val: 8
Ha aumentado su posición en 7 puestos en Visual Basic.NET (en relación al último mes)
Gráfica de Visual Basic.NET

datagridview

Publicado por ANGEL (5 intervenciones) el 16/10/2017 06:44:44
HOLA AMIGOS
SI ALGUIEN ME PUEDE AYUDAR CON ESTA CONSULTA

COMO PUEDO PASAR LAS FILAS DE UNA COLLECCION EN UNA FILA DE UN DATAGRIDVIEW PARA PODER MANIPULAR LOS DATOS

ASI ESTA MI CLASE Q LE SUBO A UNA COLLECCION

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Public Class detalle
    Structure T_PROP
        Public IdInventario As Long
        Public CodInventario As String
 
End Structure
 
Friend Sub Recuperar(oDataRow As DataRow)
        With oDataRow
            If Not IsDBNull(oDataRow("IdInventario")) Then mProps.IdInventario = oDataRow("IdInventario")
            If Not IsDBNull(oDataRow("CodInventario")) Then mProps.CodInventario = oDataRow("CodInventario")
end sub
 
 Public Property IdInventario() As Long
        Get
            IdInventario = mProps.IdInventario
        End Get
        Set(value As Long)
 
        End Set
    End Property
 
 Public Property CodInventario() As string
        Get
            codInventario = mProps.codInventario
        End Get
        Set(value As Long)
 
        End Set
    End Property
end clase detalle
 
 
PUBLIC CLASS CABECERA
    Private mcol As Collection
 
Public Property NumDetalle() As Long
        Get
            If mcol Is Nothing Then detalle.recuperar
            NumDetalle = mcol.Count
        End Get
        Set(value As Long)
        End Set
    End Property
 
    Public Property detalle(ix As Long) As detalle
        Get
            If mcol Is Nothing Then detalle.recuperar
            detalle = mcol.Item(ix)
        End Get
        Set(value As detalle)
        End Set
    End Property
 
END CLASE CABECERA

/// el problema es como cargo es el objeto detalle en un datagridview
obviamente muestro los valores en un datatable
aqui esta el codigo

1
2
3
4
5
6
7
8
9
10
11
12
13
sub mostrar
    dim det as detalle
       DATAGRIDVIEW.DataSource = ListaIDetalle // obviamente lista detalle es mi funcion tipo datatable
         For i = cabecera.numdetalle To 1 Step -1
                det = cabecera.detalle(i)
                 /// aqui es el problema como le cargo mi objeto de a una fila del datagridview para poder manipular 
                     libremente como hacia con msfrexgrid de vb6.0
                //antes yo utilizaba 
                       datarow(i) = det
 
                //
        next
end


si alguien me puede ayudar anticipos mis agradecimientos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Wilfredo Patricio Castillo
Val: 1.239
Bronce
Ha mantenido su posición en Visual Basic.NET (en relación al último mes)
Gráfica de Visual Basic.NET

datagridview

Publicado por Wilfredo Patricio Castillo (720 intervenciones) el 16/10/2017 18:32:16
Sinceramente no se entiende.

Si nos explicaras claramente que es lo que pretendes hacer, te podríamos ayudar.

Creo que te estás enredando en tu propio código, estoy seguro que eso se puede hacer de manera limpia y enlazar a un datagridview sin tanta vuelta.

Saludos cordiales,
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar