Get Datakey Value from Gridview/sqldatasource

K

KT

I need to get the unique datakeynames value from a query that is populating
the gridview and detailsview.

Example, I have a sqldatasource setup that is using a store procedure. I
have the results from it populating a gridview. However, I need the unique
id of the datakey to use for other objects on the web page. How do I get
that key?

Thanks
KT
 
R

Ranga

You can use the datakey values anywhere in the page. You can do this by
gridview.DataKeys[rowindex].Values["Id"].

Regards

RT
 
K

KT

Thanks. How do you use a return from a function with gridviews,
detailviews, etc.

KT

Ranga said:
You can use the datakey values anywhere in the page. You can do this by
gridview.DataKeys[rowindex].Values["Id"].

Regards

RT

KT said:
I need to get the unique datakeynames value from a query that is
populating the gridview and detailsview.

Example, I have a sqldatasource setup that is using a store procedure. I
have the results from it populating a gridview. However, I need the
unique id of the datakey to use for other objects on the web page. How
do I get that key?

Thanks
KT
 

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

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top