473,382 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Get GridView Cell Value

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.

Apr 5 '06 #1
3 2634
"Chris" <CL*****@gmail.com>'s wild thoughts were released on
5 Apr 2006 06:54:08 -0700 bearing the following fruit:
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.GridViewCommandEventArg s) 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)

--
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

Apr 6 '06 #2
Thanks a lot, Jan. Sometimes the property names are not very clear,
like commandargument.

Apr 7 '06 #3
"Chris" <CL*****@gmail.com>'s wild thoughts were released on
6 Apr 2006 22:51:53 -0700 bearing the following fruit:
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)

--
Divorce: Going through a change of wife. (Henny Youngman)

Apr 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jon S via DotNetMonster.com | last post by:
HI all, I'm returning a dataset to a gridview control. When the gridview asp.net control is populated from the returning dataset some of the cells remain empty. This is expected as some data...
1
by: NH | last post by:
ANy ideas on how to acheive this? I want to display a dynamically created image when a mouse over occurs on a gridview event. I need some way of creating the image (it will be a small chart type...
0
by: Mike P | last post by:
I have a number of colours in a database linked to different conditions, and this data is displayed in a gridview. I want to set the BackColor of a gridview cell dependent upon this value, for...
4
by: Tom | last post by:
I need to grab the text from a cell in my gridview and pass it in my querystring I need to do this on the client
14
by: Mike | last post by:
I have a gridview that has a button in the last cell of each row. I want to get the text from cell 1 for that row the button was clicked on. So if my gridview looks like this: N-12 BMW ...
1
by: Vyas111111 | last post by:
Hello All, How can i get the value of a gridview cell outside any GridView event
5
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
Can I set the Enabled or Visible properties of the controls (textboxes, checkboxes) displayed by default in edit mode, depending on the value of some other column? Or must I convert the column to a...
2
by: renuami | last post by:
We have a GridView2 in GridView1 EditTemplate. And we have a button (commandname="Update") on GridView2. When Button1 is clicked GridView1 goes into edit mode and displays GridView2. Now when...
3
by: anuarthi | last post by:
Hi i need to copy the one gridview cellvalue to another gridview eg: gridview1: a b c 1 s 2 2 v 3 3 d 4 The Second Gridview Value Should Be
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.