Export to Excel for grouped data in radgrid

2 posts, 0 answers
  1. t
    t avatar
    1 posts
    Member since:
    Feb 2016

    Posted 18 Feb Link to this post

    Hi,

    I have a radgrid which groups data according to Name. So, John will have all his data displayed and then greg and so on. But when I use to export to excel, it always exports the last group.

    Any ideas on this would be helpful. 

    I was also not able to find any demos for exporting grouped data.

     

    I have used the following export settings:

               string alternateText = "ExcelML";
                this.radGridBusinessGoalList.ExportSettings.Excel.Format =               (Telerik.Web.UI.GridExcelExportFormat)Enum.Parse(typeof(Telerik.Web.UI.GridExcelExportFormat), alternateText);
                this.radGridBusinessGoalList.ExportSettings.ExportOnlyData = true;
                this.radGridBusinessGoalList.ExportSettings.IgnorePaging = true;
                this.radGridBusinessGoalList.ExportSettings.OpenInNewWindow = true;

     

    Thanks,

    TM

  2. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 23 Feb Link to this post

    Hi,

    Please make sure that you are not using DataBind() to bind the grid. Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Exporting, Paging, Sorting, Filtering, etc. require accommodating appropriate database operations.  Therefore, we suggest you to avoid Simple Databinding and strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
    Declarative DataSource
    Programmatic Data Binding


    Also, you can temporarily remove the IgnorePaging and change the Format, because ExcelML has some specifics with Grouping:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/export-formats/excelml-export/excelml-basics


    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top