Last post Aug 06, 2009 04:33 AM by emmamason
Aug 04, 2009 05:24 AM|emmamason|LINK
I have a dynamic data website using linq to sql. I have added a button to the bottom of my list page. When the user clicks this button, I would like the current filtered dataset to be exported to xml. The actual exporting to xml bit is easy, but I can't
work out how to get at the filtered subset of records. I tried GridView.DataKeys but this just gives me the ids of the records on the current page. I've looked for a property in the LinqDataSource but can't find anything that returns my filtered records. What
I want is just a list of the current records so that I can iterate through them and generate my xml. Sounds so easy - does anyone know if this can be done?
Aug 04, 2009 08:27 AM|rashmika|LINK
Aug 04, 2009 08:41 AM|emmamason|LINK
But I don't have a datatable. I have a GridView bound to a LinqDataSource, like you see in any other dynamic data list.aspx page. I need to access the records in my GridView.
Aug 04, 2009 10:21 AM|rashmika|LINK
see this if it helps u..
Aug 06, 2009 04:33 AM|emmamason|LINK
OK, I found another post from someone with a similar problem, so I did what they did - reset the gridview to a large number and did a databind. This gives me ALL the records so I can iterate through them, do my export to xml and then reset the gridview
to the original page size.
I still think there must be a cleaner way to do this, but it'll have to do for now.