This is a migrated thread and some comments may be shown as answers.

RadGrid Export Not working

2 Answers 145 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 05 Oct 2016, 03:25 PM

I have an aplication which use a RadGrid, i´m trying to use built-in controls, how ever it is not working.

 

CS File

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using SCAPWEB.ods;
using System.Data;

namespace SCAPWEB.Views
{
    public partial class GridStocks : ContentControl
    {
        ScapWebServ.Service1SoapClient consulta = new ScapWebServ.Service1SoapClient();
 

        protected void Page_Load(object sender, EventArgs e)
        {
        
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "nudgeIE6", "if ($telerik.isIE6) $telerik.$('.itemDetails, .pageNav, .ordersTitle').each( function() { this.style.cssText = this.style.cssText; });", true);
        }

        protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {

            RadGrid grid = (RadGrid)sender;
            grid.DataSource  = consulta.AllExistence("NIS", this.Tipo, this.FechaInicial, this.FechaFinal,this.Flujo).Answer.Select().ToList();
 
        }
      

        protected void Page_PreRender(object sender, EventArgs e)
        {
            RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);

            manager.AjaxSettings.AddAjaxSetting(RadGridEstadistica, RadGridEstadistica,LoadingPanel);          
             
        }

       
       
    }
}

 

ViewFile

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GridStocks.ascx.cs" Inherits="SCAPWEB.Views.GridStocks" %>
<div style="width: 100%; height: 100%; float: left; margin: 10px">

    <telerik:RadGrid ID="RadGridEstadistica" runat="server" Culture="es-ES" Width="100%" Height="500px" AllowSorting="True" UseAllDataFields="True"
        AllowPaging="true" PageSize="18" ClientSettings-Scrolling-AllowScroll="true" OnNeedDataSource="RadGrid1_NeedDataSource" AllowFilteringByColumn="True" FilterType="Combined">

        <MasterTableView CommandItemDisplay="Top" PagerStyle-Mode="NextPrevAndNumeric" TableLayout="Fixed">
            <CommandItemSettings ShowExportToCsvButton="True" ShowExportToExcelButton="True" ShowExportToPdfButton="False" ShowExportToWordButton="False" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
        </MasterTableView>
        <ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="true" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="360px" />
        </ClientSettings>
    </telerik:RadGrid>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server">
    </telerik:RadAjaxLoadingPanel>
</div>

2 Answers, 1 is accepted

Sort by
0
Victor
Top achievements
Rank 1
answered on 05 Oct 2016, 03:39 PM
Sorry i forgot to describe the issue. i want to export to Excel, so i´m trying to use built-in controls and it is not working. I tried many solutions i found in another discussions in this Forum, but till now nothing helped me.
0
Konstantin Dikov
Telerik team
answered on 10 Oct 2016, 10:28 AM
Hi Victor,

Please refer to the following help article demonstrating how to use the export functionality of RadGrid with enabled AJAX:
As you will notice, the export buttons need to perform full postback and not AJAX requests in order for the exporting to work.

Hope this helps.


Regards,
Konstantin Dikov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
Victor
Top achievements
Rank 1
Answers by
Victor
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or