Link to home
Start Free TrialLog in
Avatar of vcbertini
vcbertiniFlag for United States of America

asked on

How do I get the value of a DataField in a GridView?

So here's what I want to do, and pardon if I'm not using the right terminology.

I have a gridview on my page. The data record is extraordinarly long (about 30+ columns) in the database, so instead of using the built-in "edit" function in the GridView, what I want to do is have the "Edit" field take the user to another page where I have created a Data View setup. This is more user-friendly because the user will only have to scroll vertically instead of horizontally.

The approach I want to take is to pass the ID of the record the user selects to edit from the GridView, put it into a Session Variable, then retrieve it from the Edit page to pull up the appropriate record.  What I don't know is how to find the selected "ID" in the GridView.

First, am I taking the right approach here or did I make it too hard? Is there something built-in to gridview that would be easier than passing variables into a session then retrieving them?

Second, if the variable passing is the most logical approach, how do I access it?
ASKER CERTIFIED SOLUTION
Avatar of disrupt
disrupt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vcbertini

ASKER

I couldn't get either of the examples to work well as far as putting the ID into a Session variable, but there was a comment on one of the articles that helped a bit, putting the ID straight into the URL of the link button. That's not an ideal solution for me, but it is functional for now. Thanks for the link suggestions.