Exporting items are inconsistent from RadGrid view in WPF Application

6 posts, 0 answers
  1. Kishor
    Kishor avatar
    3 posts
    Member since:
    Feb 2014

    Posted 05 Feb 2014 Link to this post

    Hello all,

    I am facing one problem, when i am sorting a data with project ID's and tried to export that data it gives inconsistent records on excel sheet.
    it will fetch till page no 4 and after that it will skip the reocrds form page no 5. and next it will take records form page 6..


    Code sample  


      private List<ChildDto> GetAllChildrenInGrid(RadGridView grid)
            {
                    List<ChildDto> children = new List<ChildDto>();

                    for (int i = 0; i < gvPagerBottom.PageCount; i++)
                    {
                        gvPagerBottom.PageIndex = i;

                        foreach (var item in grid.Items) : it gives item count 0 here
                        {
                            children.Add(item as ChildDto);
                        }
                    }

                    return children;
            }

    It will be great help if any one suggest on the same


  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Feb 2014 Link to this post

    Hello,

    Please check our online documentation on how to export paged data.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kishor
    Kishor avatar
    3 posts
    Member since:
    Feb 2014

    Posted 07 Feb 2014 in reply to Dimitrina Link to this post

    Thanks for reply

    can you please give me an exapmle how we can read result data form ".PagedSource" 

    thanks in advance
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 07 Feb 2014 Link to this post

    Hi,

    Please check the following code snippet. 
    using(Stream stream = dialog.OpenFile())
    {                 
        GridViewExportOptions exportOptions = newGridViewExportOptions();
        exportOptions.Format = ExportFormat.Html;
        exportOptions.ShowColumnFooters = true;
        exportOptions.ShowColumnHeaders = true;
        exportOptions.ShowGroupFooters = true;
        exportOptions.Items = (IEnumerable) dataPager.PagedSource;
     
        RadGridView1.Export(stream, exportOptions);
    }

    You can also refer to the Exporting WPF Demos on how to export data from RadGridView.

    Regards,
    Didie
    Telerik

    Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

  6. Kishor
    Kishor avatar
    3 posts
    Member since:
    Feb 2014

    Posted 07 Feb 2014 in reply to Dimitrina Link to this post

    Hello Didie 
    Thanks for the replying fast..

    I had tried above code in our application but now the problem is if i filtered first time and export it, its working fine. but the amazing thing is when i changed the filtered criteria its exported file with blank record... its not taking single records also 
  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 07 Feb 2014 Link to this post

    Hi,

    Would you please open a support ticket and attach a demo solution which I can check locally? You can take a look at this blog post for a reference on how to isolate an issue. 

    Regards,
    Didie
    Telerik

    Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

Back to Top
UI for WPF is Visual Studio 2017 Ready