Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/04/2006, 11:00
jhernanp
 
Fecha de Ingreso: octubre-2004
Mensajes: 71
Antigüedad: 19 años, 6 meses
Puntos: 0
Pregunta label y imagenbutton en columna de un datagrid

quiero hacer lo siguiente en una columna de un datagrid colocar un label i una imagen los cuales los asigno por codigo de acuerdo a unos calculos que realizo

los asigno de la siguiente forma
Dim btnimg As ImageButton
Dim ldd As Label

ldd = dgi.Cells(24).Controls(1)
btnimg = dgi.Cells(24).Controls(2)

al hacer esto me saca el siguiente error

Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:


Line 67: lbdl = dgi.Cells(11).Controls(1)
Line 68: ldd = dgi.Cells(24).Controls(1)
Line 69: btnimg = dgi.Cells(24).Controls(0)
Line 70: fecha = lbf.Text
Line 71: ahora = LBfecha.Text