Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

read gridview cell data

Posted on 2013-05-11
2
Medium Priority
?
744 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
rpkhare earned 2000 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 34

Author Closing Comment

by:Mike Eghtebas
ID: 39159454
Thank you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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 …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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