[Resolved] Get ID from Data grid when user clicks on hyperlink button
I have a datagrid that has several columns and several records. The last column (column7) has the ID of the record. When the user clicks the hyperlink button, I want to put the ID of the record into a session variable for use in the next web page.
Anyone have any ideas?
Thanks
Re: Get ID from Data grid when user clicks on hyperlink button
Is it a hyperlink button managed by the DataGrid or one of your own?
Re: Get ID from Data grid when user clicks on hyperlink button
It is a hyperlink that is a part of the datagrid.
Re: Get ID from Data grid when user clicks on hyperlink button
Do you have a Command Name set for it? If you do you can use Command event and the event args.
e.Item.Cells(7).Text = your key
Re: Get ID from Data grid when user clicks on hyperlink button
What sub would I use where that code would run when they click on the hyperlink? I tried DataGrid1_SelectedIndexChanged and it didn't run.
Re: Get ID from Data grid when user clicks on hyperlink button
Re: Get ID from Data grid when user clicks on hyperlink button
I put some code there and a stopper and it did not run when I clicked the hyperlink button.
Re: Get ID from Data grid when user clicks on hyperlink button
I got it. I used Select and then put the code in SelectedIndexChanged and it worked great.
Thanks for you help.