Get GridView Cell Value

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.
 
J

Jan Hyde

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)
 
C

Chris

Thanks a lot, Jan. Sometimes the property names are not very clear,
like commandargument.
 
J

Jan Hyde

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)
 
Joined
May 21, 2009
Messages
1
Reaction score
0
hello bro i am mohammed imran working on asp.net,i am having task where i should change the gridview column values into multilanguage so can any one help me out,how to change the column values and wats the code of it,waiting for ur reply,
MY emailid:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top