Get GridView Cell Value

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

In ASP.NET 2005, I am using a gridview control. I have some Buttons in
gridview for opening different forms. I use ROWCOMMAND event for
retrieving the name of the button pressed.

Can I retrieve from which row the button was pressed (ex.
grv_reports.Rows(0).Cells(4).Text) ? I have the primarykey hidden in
gridview columns and I want to send it as a parameter to the new form I
will open.


Protected Sub gridview_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
grv_reports.RowCommand
If e.CommandName = "Send" Then

End If

Thanks a lot.
 
Hi,

In ASP.NET 2005, I am using a gridview control. I have some Buttons in
gridview for opening different forms. I use ROWCOMMAND event for
retrieving the name of the button pressed.

Can I retrieve from which row the button was pressed (ex.
grv_reports.Rows(0).Cells(4).Text) ? I have the primarykey hidden in
gridview columns and I want to send it as a parameter to the new form I
will open.


Protected Sub gridview_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
grv_reports.RowCommand
If e.CommandName = "Send" Then

End If

Thanks a lot.

Take a look at the help file for

"GridView.RowCommand Event"

There is an example given there.





Jan Hyde (VB MVP)
 
Thanks a lot, Jan. Sometimes the property names are not very clear,
like commandargument.
 
Thanks a lot, Jan. Sometimes the property names are not very clear,
like commandargument.

I hear that ;-)

I also find that the help often tells me there no help
available so I go to the index and type the exact same thing
and there is the very topic I need.



Jan Hyde (VB MVP)
 
Back
Top