I am trying to export all of the data from an ultra web grid. i see that i need to change the grid to be bound to all of the data. But without completely removing the ability to page, i cannot see how to do this. Any help would be great.
Hi
I am having similar problems with a grid that was set to use AJAX to improve performance due to large amounts of data being returned.
The grid is Hierarchical, populated with up to three tables. Without AJAX on the grid, it exports to Excel with buttons one the speadsheet to allow drilling into the related data.
However when AJAX is turned on for the grid, two problems are noticed:
1. Only the first page (51 rows) of data is shown in the spreadsheet. With the Document Exporter all the data is exported correctly however when using AJAX.
2. The related data is lost when exporting an AJAX enabled grid with only the top level data being exported.
Ken Paton
When you call Export() in anything but ExportMode.Custom, it terminates the text/html MIME type response being prepared by the Page and instead begins the binary application/ms-excel MIME type download of .XLS data to the client (in a custom export, you are responsible for doing with the binary stream resulting from an export what you wish, so you could conceivably write it to a file that will be downloaded later and the HTML response can carry-on.) Unless you're doing a custom export or taking unusual steps to persist changes, the viewstate indicating you have turned off paging in the WebGrid isn't ordinarily going to survive, and the HTML of the WebGrid with all data will not be rendered to the client.
Export()
ExportMode.Custom
I would just use a seperate grid, bind it to your entire dataset and export that grid. You do not have to add this temporary grid to your form. So it would be something like:
uwg.DisplayLayout.ViewType = ViewType.OutlookGroupBy;
uwg.ID = "uwg";
uwg.DataSource = ds1;
uwg.DataMember = dt11.TableName;
uwg.DataBind();
this.form1.Controls.Add(uwgee);
Workbook wb = new Workbook();
uwgee.Export(uwg, wb.Worksheets[0]);