HyperLinkColumn in a DataGrid

G

Guest

Hello,

I have a HyperLinkColumn in a DataGrid found in a Summary page.

When the link is clicked on, I want to get the data for all fields in the
database for that record and display this data on a Details page that does
not display the data in a DataGrid but instead displays it in a series of
databound label controls.

Is this possible or do I need to display the data on my Details page in a
DataGrid?

Thanks for any pointers.

-glenn
 
J

Jason Coyne

This is very possible. You need to provide the ID for each row to the
hyperlink. You can do this in the onItemDataBound event of your
datagrid, using the FindControl() function to get the link for each
row, and then add a querystring parameter to the link. You could also
do this in the HTML view, by modifying the DataBinder.Eval syntax.

Then on your destinatino page, just grab the querystring parameter, and
display whatever data you want.

the alternative would be to use something like a LinkButton, and then
either redirect as above, or also you could stay on the same page, but
hide the datagrid and show your labels.
 
G

Guest

Jason,

Could you point me to any sample code that might illustrate how to do what
you have described?

-Glenn
 

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,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top