ASP.NET Datagrid with VB

C

Chris

I've got a datagrid on an asp.net page that loads 4 columns of data from a
SQL query. One of the columns is hidden which contains the identity column
that i use for the primary key.

On the grid, i have an edit command set so that when the button is pressed,
it'll reroute the user to another page that will display ALL data related to
that specific primary key in another grid. The problem I'm having is I
can't seem to pull the primary key out of the specific row that the user
clicked the view button for.

I'd greatly appreciate any help with this
 
M

Matt Berther

Hello Chris,
On the grid, i have an edit command set so that when the button is
pressed, it'll reroute the user to another page that will display ALL
data related to that specific primary key in another grid. The
problem I'm having is I can't seem to pull the primary key out of the
specific row that the user clicked the view button for.

Have you tried e.Item.DataItem? You should be able to cast this to the appropriate object (DataRow or a custom business object).
 
C

Chris

Worked wonderfully ... Thanks a lot Matt

Matt Berther said:
Hello Chris,


Have you tried e.Item.DataItem? You should be able to cast this to the
appropriate object (DataRow or a custom business object).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top