Foros del Web » Programación para mayores de 30 ;) » .NET »

Paginación de un DataGrid

Estas en el tema de Paginación de un DataGrid en el foro de .NET en Foros del Web. Un saludo a todos, Necesitaría saber cómo puedo incluir código javascript en los botones de paginación de un datagrid; necesito que al pulsar "siguiente" o ...
  #1 (permalink)  
Antiguo 30/08/2006, 05:05
 
Fecha de Ingreso: mayo-2005
Mensajes: 95
Antigüedad: 19 años, 10 meses
Puntos: 0
Paginación de un DataGrid

Un saludo a todos,
Necesitaría saber cómo puedo incluir código javascript en los botones de paginación de un datagrid; necesito que al pulsar "siguiente" o "anterior" se haga visible un objeto div con un mensaje de espera. A ver si podeis ayudarme, gracias.

Última edición por mellidecai; 30/08/2006 a las 08:09
  #2 (permalink)  
Antiguo 30/08/2006, 11:28
Avatar de mabarcau  
Fecha de Ingreso: mayo-2005
Mensajes: 317
Antigüedad: 19 años, 10 meses
Puntos: 0
Mira como le hice para poder cambiar los simples numeros por imagenes, no es la gran cosa, pero ya tan solo te haria falta pasarle el onclick a las imagenes.

Private Sub dgProcesos_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgProcesos.ItemCreated
If e.Item.ItemType = ListItemType.Pager Then
For Each cont As System.Web.UI.WebControls.TableCell In
e.Item.Controls
For Each cont2 As System.Web.UI.Control In
cont.Controls
If cont2.GetType.ToString =
"System.Web.UI.WebControls.DataGridLinkButton" Then
If DirectCast(cont2,
System.Web.UI.WebControls.LinkButton).Text = "..." Then
Dim pag As String = DirectCast(cont2,
System.Web.UI.WebControls.LinkButton).CommandArgum ent
If Integer.Parse(pag) <=
dgProcesos.CurrentPageIndex Then
DirectCast(cont2,
System.Web.UI.WebControls.LinkButton).Text = "<IMG id='imgAnterior'
style='CURSOR: hand' height='14' border=0 src='images/anterior.gif'
width='20'>Anterior"
Else
DirectCast(cont2,
System.Web.UI.WebControls.LinkButton).Text = "Siguiente<IMG
id='imgSiguiente' style='CURSOR: hand' height='14' border=0
src='images/siguiente.gif' width='20'>"
End If
End If
End If
Next
Next
End If
End Sub


slds.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




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