I have paging enabled and I cannot export the entire data to excel
export button:
<img src="../images/i_exportXLS.png" /> <asp:Button ID="btnExport" runat="server" Text="Export to Excel" class="button" Width="140" OnClick="btnExport_Click" /> <ig:WebExcelExporter ID="exporter" runat="server" > </ig:WebExcelExporter>
paging:
<ig:Paging PageSize="100" Enabled="true" PagingClientEvents-PageIndexChanging="batchUpdateAlert" PagerAppearance="Both" > <PagingClientEvents PageIndexChanging ="batchUpdateAlert" /> </ig:Paging>
server side export function:
protected void btnExport_Click(object sender, EventArgs e) { try {
if (wdgModifyPositions.Rows.Count >= 1) { this.exporter.Export(this.wdgModifyPositions); lblError.Visible = false; AlertPic.Visible = false; } else { lblError.Text = "Please Load Data into the Data Grid"; lblError.Visible = true; AlertPic.Visible = true; } } catch (Exception ex) { ErrorHandle.ExceptionHelper(ex); } }
I saw the examples on forum for ultragrid :
UWGrid.DisplayLayout.Pager.AllowPaging = False
and this does not work on webdatagrid. What is possible way to disable paging on webdatagrid??
Thanks!!
Hello Jdag,
To get entire data to excel sheet while exporting the grid I would recommend instead of disable paging use DataExportMode property in the WebExcelExporter. DataExportMode determines whether the grid will export the entire set of data.
In the markup add the property as :
<ig:WebExcelExporter ID="WebExcelExporter11" DataExportMode ="AllDataInDataSource" runat="server" />
You can refer the following API link, list all the member exposed by exporter.
http://help.infragistics.com/doc/ASPNET/2015.2/CLR4.0/?page=Infragistics4.Web.v15.2~Infragistics.Web.UI.GridControls.BaseExporter_members.html
Please let me know if I may be further assistance.
Dear Sirs, i have a similar problem but i can't solve with the DataExportMode as DataInGridOnly because i need to export from a filtered Datasource.
I try to explain better: in my page i'm using a WebHierarchicalDataGrid with Filtering and Paging Behaviors enabled, and (i think) that's the problem!
By now, It's impossibile to export all data when a customer use the filter for any column (and the data are in more than 1 page).
I can export each page by time.. but you can understand that's not a real solution.
I tryied also the Divya solution but i receive the Exception Thread.Ended:
Try WebHierarchicalDataGrid1.Behaviors.Paging.Enabled = False WebHierarchicalDataGrid1.DataBind() WebExcelExporter1.DownloadName = "ElencoMRP_Filtrato" WebExcelExporter1.DataExportMode = DataExportMode.DataInGridOnly 'DataExportMode.AllDataInDataSource WebExcelExporter1.Export(WebHierarchicalDataGrid1) WebHierarchicalDataGrid1.Behaviors.Paging.Enabled = True WebHierarchicalDataGrid1.DataBind() Catch ex As Exception Console.WriteLine(ex.Message) End Try
Could you please help me?
Thanks