Hello All,
Presently I am having a telerik radgrid with a commanditem template above the grid header for some extra information.But the problem is that while exporting to CSV , the header information inside the commandItem template is not being exported.However the export is working just fine with PDF and Excel .Here is the code I am using.
<telerik:RadGrid ID="ModifiedContentsReportGrid" runat="server" AutoGenerateColumns="false"
AllowSorting="true" AllowPaging="true" EnableOutsideScripts="true" PagerStyle-Mode="NextPrevAndNumeric"
ShowFooter="true" OnItemCreated="ModifiedContentsReportsGrid_OnItemCreated" Title="Modified Content Report"
Height="100%" ExportSettings-ExportOnlyData="false"
EnableViewState="true">
<ItemStyle BackColor="transparent" />
<AlternatingItemStyle BackColor="#F9F9F9" />
<ExportSettings OpenInNewWindow="true" FileName="Modified Content Report" ExportOnlyData="false" >
<Pdf PaperSize="A4" AllowPrinting="true" PageBottomMargin="10px" PageTopMargin="25px"
PageHeaderMargin="0px" PageLeftMargin="10px" PageRightMargin="10px" PageTitle="Modified Content Report" />
</ExportSettings>
<HeaderStyle HorizontalAlign="Center" />
<ClientSettings>
<Scrolling UseStaticHeaders="true" />
</ClientSettings>
<MasterTableView Width="100%" CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Right"
TableLayout="Fixed">
<CommandItemTemplate>
<asp:Literal runat="server"><b>Account Name :</b></asp:Literal>
<asp:Label ID="lblClientName" runat="server" /><br />
<asp:Literal runat="server"><b>Report generated on :</b></asp:Literal>
<asp:Label ID="lblGenerateDate" runat="server" /><br />
<asp:Literal runat="server"><b>Date Range :</b></asp:Literal>
<asp:Label ID="lblDateRange" runat="server" />
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn DataField="Name" SortExpression="Name" HeaderText="Content File"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="30%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Location" SortExpression="Location" HeaderText="Location"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="30%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Project/Folder" SortExpression="Project/Folder"
HeaderText="Project/Folder" SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Document" SortExpression="Document" HeaderText="Document"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Section" SortExpression="Section" HeaderText="Section"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="JobNumber" SortExpression="JobNumber" HeaderText="Job Number"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
</Columns>
<NoRecordsTemplate>
<asp:Literal runat="server">
No records to display.</asp:Literal>
</NoRecordsTemplate>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
Can anyone provide some some inputs or solution to this problem?
Presently I am having a telerik radgrid with a commanditem template above the grid header for some extra information.But the problem is that while exporting to CSV , the header information inside the commandItem template is not being exported.However the export is working just fine with PDF and Excel .Here is the code I am using.
<telerik:RadGrid ID="ModifiedContentsReportGrid" runat="server" AutoGenerateColumns="false"
AllowSorting="true" AllowPaging="true" EnableOutsideScripts="true" PagerStyle-Mode="NextPrevAndNumeric"
ShowFooter="true" OnItemCreated="ModifiedContentsReportsGrid_OnItemCreated" Title="Modified Content Report"
Height="100%" ExportSettings-ExportOnlyData="false"
EnableViewState="true">
<ItemStyle BackColor="transparent" />
<AlternatingItemStyle BackColor="#F9F9F9" />
<ExportSettings OpenInNewWindow="true" FileName="Modified Content Report" ExportOnlyData="false" >
<Pdf PaperSize="A4" AllowPrinting="true" PageBottomMargin="10px" PageTopMargin="25px"
PageHeaderMargin="0px" PageLeftMargin="10px" PageRightMargin="10px" PageTitle="Modified Content Report" />
</ExportSettings>
<HeaderStyle HorizontalAlign="Center" />
<ClientSettings>
<Scrolling UseStaticHeaders="true" />
</ClientSettings>
<MasterTableView Width="100%" CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Right"
TableLayout="Fixed">
<CommandItemTemplate>
<asp:Literal runat="server"><b>Account Name :</b></asp:Literal>
<asp:Label ID="lblClientName" runat="server" /><br />
<asp:Literal runat="server"><b>Report generated on :</b></asp:Literal>
<asp:Label ID="lblGenerateDate" runat="server" /><br />
<asp:Literal runat="server"><b>Date Range :</b></asp:Literal>
<asp:Label ID="lblDateRange" runat="server" />
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn DataField="Name" SortExpression="Name" HeaderText="Content File"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="30%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Location" SortExpression="Location" HeaderText="Location"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="30%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Project/Folder" SortExpression="Project/Folder"
HeaderText="Project/Folder" SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Document" SortExpression="Document" HeaderText="Document"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Section" SortExpression="Section" HeaderText="Section"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="JobNumber" SortExpression="JobNumber" HeaderText="Job Number"
SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
ItemStyle-Width="10%">
</telerik:GridBoundColumn>
</Columns>
<NoRecordsTemplate>
<asp:Literal runat="server">
No records to display.</asp:Literal>
</NoRecordsTemplate>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
Can anyone provide some some inputs or solution to this problem?