Dear All,
Here am posting the code i used in radgrid which residing inside update panel..!!The issue is when i click on export to excel which is by default available.The data retreived is not exporting to excel or any other type.Please help me in this.
Code:
<asp:UpdatePanel ID="updatepanel1" runat="server">
<ContentTemplate>
<header align="center">
<h2>Order</h2>
</header>
<div align="center">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table width="100%">
<tr align="center">
<td>
<asp:Label ID="Label1" runat="server" Font-Size="Small" Text="From Date : "></asp:Label>
<telerik:RadDatePicker ID="RadDatePickerFrom" Runat="server" DateInput-DateFormat="yyyy-MM-dd" AutoPostBack="True">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
<DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd" AutoPostBack="True"></DateInput>
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
</telerik:RadDatePicker>
</td>
<td>
<asp:Label ID="Label2" runat="server" Font-Size="Small" Text="To Date : "></asp:Label>
<telerik:RadDatePicker ID="RadDatePickerTo" Runat="server" Culture="en-GB" AutoPostBack="True" OnSelectedDateChanged="RadDatePickerTo_SelectedDateChanged">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
<DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd" AutoPostBack="True"></DateInput>
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
</telerik:RadDatePicker>
</td>
<td>
<asp:Label ID="Label3" runat="server" Font-Size="Small" Text="Location : "></asp:Label>
<telerik:RadComboBox ID="RadComboloc" Runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboloc_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem runat="server" />
<telerik:RadComboBoxItem runat="server" Text="IMPORT" Value="PS01W01" />
<telerik:RadComboBoxItem runat="server" Text="LOCAL" Value="PS01W02" />
<telerik:RadComboBoxItem runat="server" Text="ALL" Value="PS01W01','PS01W02" />
</Items>
</telerik:RadComboBox>
</td>
<td>
<asp:Label ID="Label4" runat="server" Font-Size="Small" Text="Class : "></asp:Label>
<telerik:RadComboBox ID="RadComboBoxclass" Runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBoxclass_SelectedIndexChanged" >
<Items>
<telerik:RadComboBoxItem runat="server" />
<telerik:RadComboBoxItem Text="Mens & Ladies Wear" runat="server" Value="MH" />
<telerik:RadComboBoxItem runat="server" Text="Kids Wear" Value="JH" />
</Items>
</telerik:RadComboBox>
</td>
<td>
<asp:Label ID="Label9" runat="server" Font-Size="Small" Text="PI"></asp:Label>
<telerik:RadComboBox ID="RadComboBoxpi" Runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBoxpi_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem runat="server" />
<telerik:RadComboBoxItem runat="server" Text="WITH PI" Value="WP" />
<telerik:RadComboBoxItem runat="server" Text="WITH OUT PI" Value="WOP" />
<telerik:RadComboBoxItem runat="server" Text="ALL" Value="ALL" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
<tr align="center">
<td> </td>
<td colspan="3">
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img src="images/ajax-loader.gif" alt="" />
<%-- Loading.....--%>
</ProgressTemplate>
</asp:UpdateProgress>
</td>
<td> </td>
</tr>
</table>
<%-- </ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>--%>
<telerik:RadGrid ID="Radgrid1" runat="server" ShowFooter="True" OnNeedDataSource="Radgrid1_NeedDataSource" AllowFilteringByColumn="True" AllowSorting="True" CellSpacing="0" GridLines="None" Skin="WebBlue" AutoGenerateColumns="False" OnDetailTableDataBind="Radgrid1_DetailTableDataBind" EnableHeaderContextMenu="True" OnItemCreated="Radgrid1_ItemCreated" >
<ExportSettings ExportOnlyData="True" HideStructureColumns="True" IgnorePaging="True" OpenInNewWindow="True">
</ExportSettings>
<ClientSettings EnableRowHoverStyle="true" >
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="false" ShowHeadersWhenNoRecords="true" CommandItemDisplay="Top" >
<%-- <CommandItemTemplate>
<asp:Button ID="btnExcel" Width="150px" Text="Export To Excel" OnClick="btnExcel_Click"
runat="server" />
<%-- <asp:Button ID="btnWord" Width="150px" Text="Export To Word" OnClick="btnWord_Click"
runat="server" />
<asp:Button ID="btnCSV" Width="150px" Text="Export To CSV" OnClick="btnCSV_Click"
runat="server" />
<asp:Button ID="btnPDF" Width="150px" Text="Export To PDF" OnClick="btnPDF_Click"
runat="server" />--%>
<%-- </CommandItemTemplate>--%>
<CommandItemSettings ExportToPdfText="Export to PDF" />
<DetailTables >
<telerik:GridTableView ShowFooter="true" ShowHeadersWhenNoRecords="false" PageSize="20" NoMasterRecordsText="NO RECORDS" CanRetrieveAllData="False" RetrieveAllDataFields="False" RetrieveNullAsDBNull="False" CommandItemDisplay="Top" CommandItemSettings-ShowExportToExcelButton="True" CommandItemSettings-ShowExportToPdfButton="True">
<CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="false" ShowExportToExcelButton="true" /><RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn><ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn><Columns>
<telerik:GridBoundColumn DataField="order_no" HeaderText="OrderNo" AllowFiltering="true" UniqueName="p_order" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="barcode" HeaderText="Barcode" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="supp_ref" HeaderText="Supplier Reference" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="prod_desc" HeaderText="Description" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="style" HeaderText="Style" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="size" HeaderText="Size" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="brand" HeaderText="Brand" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="unit_cost" HeaderText="Unit Cost" AllowFiltering="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="order_qtypc" Aggregate="Sum" HeaderText="Order Qty" AllowFiltering="true" >
</telerik:GridBoundColumn><telerik:GridBoundColumn DataField="recieve_qty" Aggregate="Sum" HeaderText="Received Qty" AllowFiltering="true" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="shortex" Aggregate="Sum" FilterControlAltText="Filter column column" HeaderText="Short-Excess Qty" UniqueName="column">
</telerik:GridBoundColumn>
</Columns><SortExpressions>
<telerik:GridSortExpression FieldName="order_no" SortOrder="Descending" /></SortExpressions><EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn></EditFormSettings></telerik:GridTableView></DetailTables>
<commanditemsettings exporttopdftext="Export to PDF"
showaddnewrecordbutton="False" showexporttoexcelbutton="True" ShowExportToPdfButton="True" />
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn><ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
</ExpandCollapseColumn><Columns>
<telerik:GridBoundColumn DataField="p_order" HeaderText="OrderNo" AllowFiltering="true" UniqueName="p_order" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="pi_no" FilterControlAltText="Filter column4 column" HeaderText="PI NO" UniqueName="column4" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="name" HeaderText="SupplierName" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="location" HeaderText="Location" AllowFiltering="true" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="entry_date" HeaderText="EntryDate" AllowFiltering="true" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Tqty" Aggregate="Sum" FilterControlAltText="Filter column1 column" HeaderText="Total Order Qty" UniqueName="column1">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="tamount" Aggregate="Sum" FilterControlAltText="Filter column column" HeaderText="Total Amount" UniqueName="column" DataFormatString="{0:n}" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="recqty" Aggregate="Sum" FilterControlAltText="Filter column2 column" HeaderText="Total Receive Qty" UniqueName="column2">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="recamt" Aggregate="Sum" FilterControlAltText="Filter column3 column" HeaderText="Total Amt " UniqueName="column3">
</telerik:GridBoundColumn>
</Columns><EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings></MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Black">
</HeaderContextMenu>
</telerik:RadGrid>
</div>
<!--<p>Vitae natoque dictum etiam semper magnis enim feugiat convallis convallis
egestas rhoncus ridiculus in quis risus amet curabitur tempor orci penatibus.
Tellus erat mauris ipsum fermentum etiam vivamus eget. Nunc nibh morbi quis
fusce hendrerit lacus ridiculus.</p>
<div class="row">
<div class="4u">
<article class="item">
<a href="#" class="image fit"><img src="images/pic02.jpg" alt="" /></a>
<header>
<h3>Ipsum Feugiat</h3>
</header>
</article>
<article class="item">
<a href="#" class="image fit"><img src="images/pic03.jpg" alt="" /></a>
<header>
<h3>Rhoncus Semper</h3>
</header>
</article>
</div>
<div class="4u">
<article class="item">
<a href="#" class="image fit"><img src="images/pic04.jpg" alt="" /></a>
<header>
<h3>Magna Nullam</h3>
</header>
</article>
<article class="item">
<a href="#" class="image fit"><img src="images/pic05.jpg" alt="" /></a>
<header>
<h3>Natoque Vitae</h3>
</header>
</article>
</div>
<div class="4u">
<article class="item">
<a href="#" class="image fit"><img src="images/pic06.jpg" alt="" /></a>
<header>
<h3>Dolor Penatibus</h3>
</header>
</article>
<article class="item">
<a href="#" class="image fit"><img src="images/pic07.jpg" alt="" /></a>
<header>
<h3>Orci Convallis</h3>
</header>
</article>
</div>
</div>-->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>​