But based on the datagrid.SelectedItem.Cells collection you can get the
cells for the selected row in your datagrid during the postback.
Add the data from each of the cells to the instance custom class or
structure, then add that to the cache.
See the "MyDataGrid_Select" method in the example at :
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemWebUIWebControlsDataGridClassSelectedIn dexTopic.asp.
Note: if you want to run the VB version that sample code you'll have to
change the line
"Dim Cart As DataTable"
to
"Dim Cart As New DataTable()"
Slight bug in the docs.... :)
Hope this helps,
bliz
--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft
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.
--------------------
From: "David" <no****@nospam.com>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References: <Rx********************@twister.socal.rr.com>
<22**************@cpmsftngxa09.phx.gbl>Subject: Re: datagrid created from a view
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <Oj********************@twister.socal.rr.com>
Date: Thu, 03 Jul 2003 01:05:50 GMT
NNTP-Posting-Host: 24.24.137.170
X-Complaints-To: ab***@rr.com
X-Trace: twister.socal.rr.com 1057194350 24.24.137.170 (Wed, 02 Jul 2003
18:05:50 PDT)NNTP-Posting-Date: Wed, 02 Jul 2003 18:05:50 PDT
Organization: RoadRunner - West
Path:
cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfee d-east.nntpserve
r.com!nntpserver.com!news-west.rr.com!cyclone.kc.rr.com!cyclone2.kc.rr.com!n
ews2.kc.rr.com!twister.socal.rr.com.POSTED!53ab275 0!not-for-mailXref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:31897
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
The datagrid's datasource is a collection object.
dgMyDataGrid.DataSource = myCollectionObject.
But I would not know how to make recognize the selected single object
withinthe collection when the user selects the row. How would I do that in the
web environment. I know that is easy in windows forms.
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
the items.)
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,
bliz
--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft
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.