Foros del Web

Foros del Web (http://www.forosdelweb.com/)
-   ASPX (.net) (http://www.forosdelweb.com/f78/)
-   -   DataGrid (http://www.forosdelweb.com/f78/datagrid-583467/)

mdavila 06/05/2008 09:49

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 06/05/2008 12:02

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


La zona horaria es GMT -6. Ahora son las 06:29.

Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.