How to assign DataView to Datatable
-
I sort the datatable and hence store it in dataview. I use dataView.Sort. GridView.DataSource = SortedDataView; GridView.DataBind(); I get the sorted grid now. When I click edit, the sort goes off. So I try to store it in a cache Cache["AdminGrid"] = SortedDataView; Iam unable to retrieve it into a datatable again. DataTable dtData = (DataTable)Cache["AdminGrid"]; results in an error saying DataView cannot be converted into DataTable. Any help is appreciated.
Thanks
-
I sort the datatable and hence store it in dataview. I use dataView.Sort. GridView.DataSource = SortedDataView; GridView.DataBind(); I get the sorted grid now. When I click edit, the sort goes off. So I try to store it in a cache Cache["AdminGrid"] = SortedDataView; Iam unable to retrieve it into a datatable again. DataTable dtData = (DataTable)Cache["AdminGrid"]; results in an error saying DataView cannot be converted into DataTable. Any help is appreciated.
Thanks