This question is locked. New answers and comments are not allowed.
Hi,
I have a RadDataPager that is bound in XAML to a WCF RIA Service domain data source and this pager is providing the PagedSource for my GridView.
I want to provide the user with options to export either the current page of grid data or all the grid data to an Excel file via the file save dialog. The issue I have is that when I change the PageSize property of my pager, the RIA service is called to retrieve all the data. As this call happens async there is no way for me to then invoke the file save dialog once the data has been returned, due to the security restrictions in Silverlight.
Due to the size of the data being displayed a pager is required. Does anyone know of way this can be achieved? The below code shows what I am trying to do:
Regards,
Chris
I have a RadDataPager that is bound in XAML to a WCF RIA Service domain data source and this pager is providing the PagedSource for my GridView.
I want to provide the user with options to export either the current page of grid data or all the grid data to an Excel file via the file save dialog. The issue I have is that when I change the PageSize property of my pager, the RIA service is called to retrieve all the data. As this call happens async there is no way for me to then invoke the file save dialog once the data has been returned, due to the security restrictions in Silverlight.
Due to the size of the data being displayed a pager is required. Does anyone know of way this can be achieved? The below code shows what I am trying to do:
var saveFileDialog = new SaveFileDialog { DefaultExt = extension, Filter = string.Format("{0} files (*.{1})|*.{1}|All files (*.*)|*.*", format, extension), FilterIndex = 1 }; if (saveFileDialog.ShowDialog() == true) { // Store original pager settings int originalPageSize = radDataPager.PageSize; int originalPageIndex = radDataPager.PageIndex; using (Stream fileStream = saveFileDialog.OpenFile()) { if (allData) radDataPager.PageSize = 0; this.InstanceGrid.Export(fileStream, new GridViewExportOptions { Format = format1, ShowColumnFooters = true, ShowColumnHeaders = true, ShowGroupFooters = true }); } // Restore pager settings radDataPager.PageSize = originalPageSize; radDataPager.PageIndex = originalPageIndex; }Regards,
Chris