Persisting a DataView

lalilo

New Member
I am using a datagrid which allows sorting and also allows a row to be selected. The problem I'm having is that after I do a sort, then click on a row to select it, what I'm getting is the original row in that position, not the row in that position after the sort<BR><BR>(ie original row 3 has date field of 3/28/2000 after sort, row 3 has date field of 5/19/2001. When I click on row 3, after sorting, I get 3/28/2000 as my date)<BR><BR>I had previously, solved this by saving a DataView of the dataset to the Cache, then always binding to the DataView instead of the dataset.<BR><BR>I'm trying to get away from using the cache and instead persist things in ViewState (a server limitation).<BR><BR>I find that I can convert the DataView to an XML string and save it to ViewState OK, but I can't figure out how to pull the string from ViewState and convert it back to a DataView. When I try something like:<BR><BR> Dim DView As DataView<BR><BR>Dim strReader As New System.IO.StringReader(ViewState("strDataView")) <BR><BR>DView.Readxml(ViewState("strDataView")) <BR><BR> <BR>I get an error indicating that "ReadXML is not a member of DataView"<BR><BR>Any suggestions on how to save a DataView to ViewState as an XML String then retrieve it again as a DataView?<BR><BR>Thanks,<BR><BR>Tom T
 
Back
Top