Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
103
Grid theme while exporting using WebExcelExporter
posted

Hi.

I am trying to export WebDataGrid Data using WebExcelExporter. I am using Infragistics 10.3.20103.2217.

I am able to download data for i am loosing the grid theme. How can i get the grid theme while downloading the gird data.

Here is my aspx page code

<asp:UpdatePanel ID="uwgCostCenterAdminUpdatePanel" runat="server">
                    <ContentTemplate>
                        <ig:WebDataGrid ID="uwgCostCenterAdmin" runat="server" AutoGenerateColumns="false"
                            Font-Size="Medium" DataKeyFields="CostCenter_id" Width="590px" OnInitializeRow="uwgCostCenterAdmin_InitializeRow"
                            EnableAjax="true" AjaxIndicator-ImageUrl="../../images/Loading.gif" OnPageIndexChanged="uwgCostCenterAdmin_PageIndexChanged"
                            OnColumnSorted="uwgCostCenterAdmin_ColumnSorted">
                            <Behaviors>
                                <ig:Paging Enabled="true" PageSize="15" QuickPages="10" PagerMode="NumericFirstLast">
                                </ig:Paging>
                                <ig:Sorting Enabled="true" SortingMode="Single" AscendingImageUrl="../../images/arrow_up.gif"
                                    DescendingImageUrl="../../images/arrow_down.gif">
                                    <ColumnSettings>
                                        <ig:SortingColumnSetting ColumnKey="Configure" Sortable="false" />
                                    </ColumnSettings>
                                </ig:Sorting>
                            </Behaviors>
                            <Columns>
                                <ig:BoundDataField Key="CostCenter_id" CssClass="hidden" DataFieldName="CostCenter_id">
                                    <Header CssClass="hidden" />
                                </ig:BoundDataField>
                                <ig:TemplateDataField Key="CostCenter" Width="20%">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="costcenterLink" runat="server" Text='<%# Eval("CostCenter") %>'></asp:HyperLink>
                                    </ItemTemplate>
                                    <Header Text="Cost Center" />
                                </ig:TemplateDataField>
                                <ig:BoundDataField Key="Name" DataFieldName="CostCenter_Name" Width="30%">
                                    <Header Text="Name" />
                                </ig:BoundDataField>
                                <ig:BoundDataField Key="Description" DataFieldName="CostCenter_Desc" Width="35%">
                                    <Header Text="Description" />
                                </ig:BoundDataField>
                                <ig:TemplateDataField Key="Configure" Width="15%">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="costcenterConfigureLink" runat="server" Text="Configure"></asp:HyperLink>
                                    </ItemTemplate>
                                    <Header Text="Configure" />
                                </ig:TemplateDataField>
                            </Columns>
                        </ig:WebDataGrid>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="imgGo" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="cmbGroup" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>

-- WebExcelExporter

<ig:WebExcelExporter ID="WebExcelExporter1" runat="server" DataExportMode="AllDataInDataSource"
        ExportMode="Download" OnCellExporting="WebExcelExporter1_CellExporting">
    </ig:WebExcelExporter>

 

-- in Codebehind in Download Click event here is my code.

   uwgCostCenterAdmin.Behaviors.Paging.Enabled = false;
                BindGrid();
                uwgCostCenterAdmin.Columns[4].Hidden = true;
                WebExcelExporter1.DownloadName = "TEST";
                this.WebExcelExporter1.Export(uwgCostCenterAdmin);
                uwgCostCenterAdmin.Behaviors.Paging.Enabled = true;
                BindGrid();

 

Please let me know what is wrong in my code. I need my grid theme to downloaded in my excel.

Thanks

Nagasai

Parents Reply Children
No Data