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

Exporting items are inconsistent from RadGrid view in WPF Application

5 Answers 5 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kishor
Top achievements
Rank 1
Kishor asked on 05 Feb 2014, 06:09 AM
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


5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Feb 2014, 05:26 PM
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 >>
0
Kishor
Top achievements
Rank 1
answered on 07 Feb 2014, 07:49 AM
Thanks for reply

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

thanks in advance
0
Dimitrina
Telerik team
answered on 07 Feb 2014, 08:40 AM
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).

0
Kishor
Top achievements
Rank 1
answered on 07 Feb 2014, 10:55 AM
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 
0
Dimitrina
Telerik team
answered on 07 Feb 2014, 11:56 AM
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).

Tags
General Discussions
Asked by
Kishor
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Kishor
Top achievements
Rank 1
Share this question
or