Solved

read gridview cell data

Posted on 2013-05-11
2
726 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
Comment Utility
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
Comment Utility
Thank you.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Open a folder with partial name 14 28
Trouble with References... 5 22
Code enhancement 5 12
Make a border less form movable 2 11
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now