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

Export to Exl

1 Answer 17 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 1
Vijay asked on 12 Sep 2011, 09:36 PM
Hi

I am trying to export data in the RadGridView to Excel i am using

EntityQueryPagedCollectionView from devforce as the data source to the grid through RadDataPager.

when i am trying to export it is only exporting the current page .

using (var fileStream = dialog.OpenFile())
            {
                DataSource.PageSize = 0;
                var exportOptions = new GridViewExportOptions
                                        {
                                            Format = ExportFormat.ExcelML,
                                            ShowColumnFooters = false,
                                            ShowColumnHeaders = true,
                                            ShowGroupFooters = false,
                                            Items = (IEnumerable)_dataPager.PagedSource
 
                                        };
                _gridView.Export(fileStream, exportOptions);
            }
            DataSource.PageSize = originalPageSize;
            _dataPager.PageSize = originalPageSize;
            _dataPager.PageIndex = originalPageIndex;
public EntityQueryPagedCollectionView DataSource
        {
            get { return _dataSource; }
            set { _dataSource = value; NotifyOfPropertyChange(() => DataSource); }
        }

I set the page size of DataSource to zero instead of the datapager .
I think i am missing something here can anyone please help me .

Thanks!
Vijay

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 Sep 2011, 06:54 AM
Hello Vijay,

 You need to download all the data if you want to export all pages - similar demo can be found here:
http://demos.telerik.com/silverlight/#GridView/ExportingPagedData

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Vijay
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or