Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/09/2010, 05:54
Avatar de jaullo
jaullo
 
Fecha de Ingreso: abril-2009
Mensajes: 994
Antigüedad: 15 años
Puntos: 30
Respuesta: Como puedo identificar un boton dentro de un gridview (hay 2 botones)

Puedes hacerlo obteniendo el index de la fila en la que se hace clic. Por ejemplo puedes crear para cada boton una funcion y llamarla en el evento onclick. Algo asi

Código ASP:
Ver original
  1. Protected Sub gvbtnCut_Click(ByVal sender As Object, ByVal e As ImageClickEventArgs)
  2.         Dim ib As ImageButton = DirectCast(sender, ImageButton)
  3.         Dim index As Integer = Convert.ToInt32(ib.CommandArgument)
  4.         Dim lb As LinkButton = DirectCast(gvwFiles.Rows(index).FindControl("gvlnkname"), LinkButton)
  5.         Dim items As New List(Of String)()
  6.         items.Add(lb.CommandArgument)
  7.         ViewState("clipboard") = items
  8.         ViewState("action") = "cut"
  9.  
  10.     End Sub
__________________
http://geekswithblogs.net/jaullo/Default.aspx
Si te he ayudado regalame Karma positivo!!!