Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

read gridview cell data

Posted on 2013-05-11
2
Medium Priority
?
746 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 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview

876 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