Retroceder   Foros del Web > Programación para sitios web > .NET > web forms

Respuesta
 
Herramientas Desplegado
Antiguo 06-may-2008, 09:49   #1 (permalink)
mdavila ha deshabilitado el karma
 
Fecha de Ingreso: julio-2007
Mensajes: 395
DataGrid

Hola tengo un DataGrid y no se porque cuando la recorro me da bien el primer nombre de header pero en los siguientes me aparecen ""


If e.Item.ItemType = ListItemType.Header then
For Each tc As TableCell In e.Item.Cells
If tc.Text = "Nombre" then
'algo
end if
Next
End If


El primer tc me da el nombre correcto, luego los otros me dan vacios......
Esto lo hago en el evento de DataGrid_ItemDataBound
mdavila está desconectado   Responder Citando
Antiguo 06-may-2008, 12:02   #2 (permalink)
mdavila ha deshabilitado el karma
 
Fecha de Ingreso: julio-2007
Mensajes: 395
Re: DataGrid

Ya ta, lo resolvi solito :) , gracias igual.

Protected Sub DgInmuebles_ItemDataBound1(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DgInmuebles.ItemDataBound
If Page.IsPostBack Then
If e.Item.ItemType = ListItemType.Header Then
For Each tc As TableCell In e.Item.Cells
If tc.Controls.Count > 0 Then
If lblCurrentSort.Text.StartsWith(CType(tc.Controls(0 ), _
System.Web.UI.WebControls.LinkButton).CommandArgum ent) Then
Dim img As New System.Web.UI.WebControls.Image
If lblCurrentSort.Text.IndexOf("desc") >= 0 Then
img.ImageUrl = "images/arriba.gif"
Else
img.ImageUrl = "images/abajo.gif"
End If
tc.Controls.AddAt(0, img)
End If
End If
Next
End If
End If
End Sub
mdavila está desconectado   Responder Citando
Respuesta
No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 02:23.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93