Couldn't you just put the data from the selected grid row into an object
and store that in the context items collection? (Define your own class or
structure to hold the data, then create an instance of it and place it in
Then you could pull the object out on page2 and you would have all the data
you need (rather than just pulling the key out of the context items).
Hope this helps,
Sr .NET Developer Evangelist
Your Potential. Our Passion.
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.
--------------------16:04:17 PDT)>From: "David" <nospamnospam.com>
>Subject: datagrid created from a view
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Date: Wed, 02 Jul 2003 23:04:17 GMT
>X-Trace: twister.socal.rr.com 1057187057 220.127.116.11 (Wed, 02 Jul 2003cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin>NNTP-Posting-Date: Wed, 02 Jul 2003 16:04:17 PDT
>Organization: RoadRunner - West
socal.rr.com.POSTED!53ab2750!not-for-mailwant>Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:31882
>I have a datagrid populated with rows from a view. Because they are from a
>view, the rows are not actual database records, and therefore lack unique
>So I have a command button for each row. When the button is pressed, I>to go to another page with all the information in that selected row.
>Normally I would do this (if the rows are actual records, that is)
>//take the datakey value
>string selected_id = dgMyDataGrid.DataKeys[e.Item.ItemIndex]
>//and do this before tranfering to another page.
>Then on the second page, I would take the selected_id and retreive the
>record from the database (I've always wondered if that trip to the database
>server would be necessary).
>But I can't even do this with rows from a view because there is no unique
>identifier. But I still want to take the row from the view and give it to
>the destination page.