Hi,
I'm using version 2010.2.826.40.
My RadGrid exports work fine until I do a column sort or group. Then, when trying to export, the entire grid simply re-displays itself in the browser.
Here's my code.
Thanks much,
Dan Cogswell
<asp:EntityDataSource ID="edsEmployees" runat="server" ConnectionString="name=dbIT_Entities"
DefaultContainerName="dbIT_Entities" EnableDelete="false" EnableInsert="False"
EnableUpdate="False" EntitySetName="ActivePhoneLists" EnableFlattening="False"
OrderBy="it.LastName, it.FirstName" />
<asp:EntityDataSource ID="edsDepartments" runat="server" ConnectionString="name=dbIT_EmployeesEntities"
DefaultContainerName="dbIT_EmployeesEntities" EntitySetName="Departments" EnableFlattening="False" />
<telerik:RadGrid ID="rgEmployees" Skin="WebBlue" ShowGroupPanel="True" runat="server" DataSourceID="edsEmployees"
AllowAutomaticDeletes="False" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
AllowSorting="True" AllowFilteringByColumn="true" AutoGenerateColumns="False"
GridLines="None" PagerStyle-Position="Top" AllowPaging="true"
ClientSettings-Scrolling-AllowScroll="false" ShowStatusBar="true" >
<ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
<Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<GroupingSettings ShowUnGroupButton="true" />
<ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true"
Pdf-PageLeftMargin=".5in"
Pdf-PageRightMargin=".5in" Pdf-PageTitle="CMRP Phonebook" Pdf-PageHeight="8.5in" Pdf-PageWidth="11in"
OpenInNewWindow="true"></ExportSettings>
<MasterTableView DataKeyNames="EmployeeNumber" GroupLoadMode="Client" CommandItemDisplay="Top" >
<CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" />
<HeaderStyle HorizontalAlign="Left" />
<Columns>
<telerik:GridBoundColumn ReadOnly="true" DataField="EmployeeNumber" UniqueName="EmployeeNumber"
HeaderText="Employee Num" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ItemStyle-Width="80px"
HeaderStyle-Width="80px" FilterControlWidth="50px">
<HeaderStyle Width="80px" />
<ItemStyle Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ItemStyle-Width="80px"
HeaderStyle-Width="80px" FilterControlWidth="50px">
<HeaderStyle Width="80px" />
<ItemStyle Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" ItemStyle-Width="90px"
HeaderStyle-Width="90px" FilterControlWidth="50px">
<HeaderStyle Width="90px" />
<ItemStyle Width="90px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="DeptId" DataField="DeptId" HeaderText="Dept"
ItemStyle-Width="60px" HeaderStyle-Width="80px" FilterControlWidth="60px">
<FilterTemplate>
<telerik:RadComboBox ID="rcbDepartment" DataSourceID="edsDepartments" DataTextField="DeptId"
DataValueField="DeptId" AppendDataBoundItems="true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("DeptId").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="DepartmentIndexChanged" Width="60px">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function DepartmentIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("DeptId", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Title" HeaderText="Title" MaxLength="250" ItemStyle-Width="150px"
HeaderStyle-Width="150px" FilterControlWidth="110px" ItemStyle-Wrap="false">
<HeaderStyle Width="150px" />
<ItemStyle Width="150px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Building" HeaderText="Building" ItemStyle-Width="125px"
HeaderStyle-Width="125px" FilterControlWidth="85px" ItemStyle-Wrap="false">
<HeaderStyle Width="125px" />
<ItemStyle Width="125px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Room" HeaderText="Room" ItemStyle-Width="100px"
HeaderStyle-Width="100px" FilterControlWidth="60px" ItemStyle-Wrap="false">
<HeaderStyle Width="100px" />
<ItemStyle Width="100px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CellPhone" HeaderText="CellPhone" ItemStyle-Width="90px"
HeaderStyle-Width="90px" FilterControlWidth="50px">
<HeaderStyle Width="90px" />
<ItemStyle Width="90px" />
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
I'm using version 2010.2.826.40.
My RadGrid exports work fine until I do a column sort or group. Then, when trying to export, the entire grid simply re-displays itself in the browser.
Here's my code.
Thanks much,
Dan Cogswell
<asp:EntityDataSource ID="edsEmployees" runat="server" ConnectionString="name=dbIT_Entities"
DefaultContainerName="dbIT_Entities" EnableDelete="false" EnableInsert="False"
EnableUpdate="False" EntitySetName="ActivePhoneLists" EnableFlattening="False"
OrderBy="it.LastName, it.FirstName" />
<asp:EntityDataSource ID="edsDepartments" runat="server" ConnectionString="name=dbIT_EmployeesEntities"
DefaultContainerName="dbIT_EmployeesEntities" EntitySetName="Departments" EnableFlattening="False" />
<telerik:RadGrid ID="rgEmployees" Skin="WebBlue" ShowGroupPanel="True" runat="server" DataSourceID="edsEmployees"
AllowAutomaticDeletes="False" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
AllowSorting="True" AllowFilteringByColumn="true" AutoGenerateColumns="False"
GridLines="None" PagerStyle-Position="Top" AllowPaging="true"
ClientSettings-Scrolling-AllowScroll="false" ShowStatusBar="true" >
<ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
<Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<GroupingSettings ShowUnGroupButton="true" />
<ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true"
Pdf-PageLeftMargin=".5in"
Pdf-PageRightMargin=".5in" Pdf-PageTitle="CMRP Phonebook" Pdf-PageHeight="8.5in" Pdf-PageWidth="11in"
OpenInNewWindow="true"></ExportSettings>
<MasterTableView DataKeyNames="EmployeeNumber" GroupLoadMode="Client" CommandItemDisplay="Top" >
<CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" />
<HeaderStyle HorizontalAlign="Left" />
<Columns>
<telerik:GridBoundColumn ReadOnly="true" DataField="EmployeeNumber" UniqueName="EmployeeNumber"
HeaderText="Employee Num" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ItemStyle-Width="80px"
HeaderStyle-Width="80px" FilterControlWidth="50px">
<HeaderStyle Width="80px" />
<ItemStyle Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ItemStyle-Width="80px"
HeaderStyle-Width="80px" FilterControlWidth="50px">
<HeaderStyle Width="80px" />
<ItemStyle Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" ItemStyle-Width="90px"
HeaderStyle-Width="90px" FilterControlWidth="50px">
<HeaderStyle Width="90px" />
<ItemStyle Width="90px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="DeptId" DataField="DeptId" HeaderText="Dept"
ItemStyle-Width="60px" HeaderStyle-Width="80px" FilterControlWidth="60px">
<FilterTemplate>
<telerik:RadComboBox ID="rcbDepartment" DataSourceID="edsDepartments" DataTextField="DeptId"
DataValueField="DeptId" AppendDataBoundItems="true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("DeptId").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="DepartmentIndexChanged" Width="60px">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function DepartmentIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("DeptId", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Title" HeaderText="Title" MaxLength="250" ItemStyle-Width="150px"
HeaderStyle-Width="150px" FilterControlWidth="110px" ItemStyle-Wrap="false">
<HeaderStyle Width="150px" />
<ItemStyle Width="150px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Building" HeaderText="Building" ItemStyle-Width="125px"
HeaderStyle-Width="125px" FilterControlWidth="85px" ItemStyle-Wrap="false">
<HeaderStyle Width="125px" />
<ItemStyle Width="125px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Room" HeaderText="Room" ItemStyle-Width="100px"
HeaderStyle-Width="100px" FilterControlWidth="60px" ItemStyle-Wrap="false">
<HeaderStyle Width="100px" />
<ItemStyle Width="100px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CellPhone" HeaderText="CellPhone" ItemStyle-Width="90px"
HeaderStyle-Width="90px" FilterControlWidth="50px">
<HeaderStyle Width="90px" />
<ItemStyle Width="90px" />
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>