This is how my source page looks like
<telerik:RadGrid ID="radGridWrapper" runat="server" ShowHeader="false" BorderStyle="None" Width="100%" onexcelmlexportstylescreated="radGridWrapper_ExcelMLExportStylesCreated" onexcelmlexportrowcreated="radGridWrapper_ExcelMLExportRowCreated" > <MasterTableView Width="100%"> <ItemTemplate> <div id="id1" runat="server" style="width:800px;text-align:left; overflow:hidden;"> <telerik:RadGrid ID="RadGrid1" Width="100%" GridLines="Vertical" AllowPaging="true" PageSize="100" runat="server" AllowSorting="True" BackColor="white" Skin="Web20" onitemdatabound="RadGrid1_ItemDataBound" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="Arial" onexcelmlexportstylescreated="RadGrid1_ExcelMLExportStylesCreated" HeaderStyle-Wrap="true" onneeddatasource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemCreated" OnSortCommand="RadGrid1_SortCommand" OnInsertCommand="RadGrid1_InsertCommand" ongridexporting="RadGrid1_GridExporting" onpdfexporting="RadGrid1_PdfExporting" onpageindexchanged="RadGrid1_PageIndexChanged"> <PagerStyle Mode="NumericPages" /> <ClientSettings > <Scrolling UseStaticHeaders="true" AllowScroll="true"/> </ClientSettings> <ItemStyle Font-Names="Arial" HorizontalAlign="Left" BackColor="white"></ItemStyle> <AlternatingItemStyle Font-Names="Arial" HorizontalAlign="Left" BackColor="white"/> <MasterTableView Width="100%"> </MasterTableView> </telerik:RadGrid> </div> </td> <%-- </div>--%> <tr> <td style="height: 72px"> <telerik:RadGrid ID="RadGrid2" Width="100%" GridLines="Vertical" Visible="false" runat="server" AllowSorting="True" Skin="Web20" AllowPaging="true" PageSize="100" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true" OnSortCommand="RadGrid2_SortCommand" HeaderStyle-Font-Names="Arial" onneeddatasource="RadGrid2_NeedDataSource" HeaderStyle-Wrap="true" onpageindexchanged="RadGrid2_PageIndexChanged"> <PagerStyle Mode="NumericPages" /> <ItemStyle Font-Names="Arial" HorizontalAlign="Left"></ItemStyle> <AlternatingItemStyle Font-Names="Arial" HorizontalAlign="Left" /> <MasterTableView Width="100%"> </MasterTableView> </telerik:RadGrid> <br /> </td> </tr> <%-- </div>--%> </ItemTemplate> </MasterTableView> </telerik:RadGrid>but i had a question in this i have set page size as 100 as you can see so when i am exporting to excel only the 100 items are getting exported (which is right).
this is my code behind method for exporting
RadGrid radGrid = lbl_txt.Text == "All RadGrids" ? radGridWrapper : (RadGrid)radGridWrapper.Items[0].FindControl(lbl_txt.Text); //html.Visible = false; if (radGrid.Items.Count == 0) { Page.ClientScript.RegisterStartupScript(base.GetType(), "Alert", GC.Message("No records found")); return; } if (isExcelExport = true) { gridcaption = "<b style='color: blue; text-align: left;'>Effort Analysis Report </b>"; if (CheckBox4.Checked == true) { gridcaption += "<BR/>" + "<b>Process : </b>" + ddlprocess.SelectedItem.Text + " " + "|" + " " + "<b>Group : </b> " + ddlGroupby.SelectedItem.Text + " " + "|" + " " + "<b>From Date :</b>" + txtFromDate.Text + " " + "|" + " " + "<b>To Date :</b>" + txtToDate.Text; } radGrid.MasterTableView.Caption = gridcaption; radGrid.ExportSettings.FileName = "EffortAnalysis_" + "_from_" + txtFromDate.Text + "_to_" + txtToDate.Text; radGrid.ExportSettings.OpenInNewWindow = true; //radGrid.ExportSettings.IgnorePaging = true; //radGrid.ExportSettings.ExportOnlyData = true; gridBind(); radGrid.MasterTableView.ExportToExcel();so if in this method i add in export settings as ignore paging i am getting an error saying the below message
Object reference not set to an instance of an object.
can any of you guys tell me how i can get over this speed bump