Solved

read gridview cell data

Posted on 2013-05-11
2
730 Views
Last Modified: 2013-05-12
I wonder if it is possible to read the content of a select cell via a click on that cell. Say, row 2 and column 3 displays "abc" string. Now, when user clicks on this cell, I want the following code to be executed in some event:

dim strTemp As String = <cell content "abc">
Response.write(strTemp)

Upon click on this cell, it is expected string "abc" to appear on the web page.

What event(s) in a gridview this code should go? I can use any other control you may suggest capable of this function where the data is displayed in a tabular fashion.

(If I was using MS Access, for example, I could have done this via a listbox control or subform.)

The link below explains the process but I am not quite sure how to apply it yet:

http://www.dreamincode.net/forums/topic/184448-using-gridview-and-rowcommand-events/

Someone explained how I can doe this by saying:

"... you can pull in a couple of arguments from the GridViewCommandEventArgs.  You can get the CommandName and the CommandArgument.  You will see when you add LinkButtons and Buttons that they have CommandNames and CommandArgument properties which can be set.  During the databinding you can dynamically assign values to these properties such as a column index.
Then in the rowcommand event you will have access to them by way of the GridViewCommandEventArgs."

You can see this in the last code block of the above link.

Question: Could you please help me to make this work? You could possibly help me to understand it all by a sample code.

Thank you.
0
Comment
Question by:Mike Eghtebas
2 Comments
 
LVL 8

Accepted Solution

by:
rpkhare earned 500 total points
ID: 39159126
Check the last solution titled "Making each GridView individual cells Clickable and Selectable" in this link:

Making each GridView individual cells Clickable and Selectable:

Also check this link:
Edit Individual GridView Cells in ASP.NET
0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 39159454
Thank you.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question