﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Lounge - Export to Excel in Webgrid not exporting All the Records in virtual Mode </title><link>http://www.intersoftsolutions.com/Community/Lounge/Export-to-Excel-in-Webgrid-not-exporting-All-the-Records-in-virtual-Mode/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Export to Excel in Webgrid not exporting All the Records in virtual Mode </title><link>http://www.intersoftsolutions.com/Community/Lounge/Export-to-Excel-in-Webgrid-not-exporting-All-the-Records-in-virtual-Mode/</link><pubDate>Thu, 15 Dec 2016 08:04:26 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;The ExportAllData will not work if VirtualLoadMode is set to Custom or LargeData. For such scenario, you might want to try this approach: re-creating the table that will be exported by utilizing OnExport server-side event of WebGrid.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;WebGrid has OnExport server-side event which allows you to use your own exporting codes or module to handle exporting functionality.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I managed to export all data by modifying WebGridRowCollection such as shown in the following snippet code (please note that following snippet code works for WebGrid's data binding performed at OnInitializeDataSource event):&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;protected void WebGrid1_Export1(object sender, ExportEventArgs e)
{
    e.Table.Rows.Clear();

    DataRowCollection rows = (e.DataSource as System.Data.DataView).ToTable().Rows;

    foreach (DataRow row in rows)
    {
        var wgRow = e.Table.CreateRow();

        foreach (WebGridColumn col in e.Table.Columns)
        {
            if (!col.IsRowChecker)
            {
                wgRow.Cells.GetNamedItem(col.Name).Value = row[col.DataMember];
                wgRow.Cells.GetNamedItem(col.Name).Text = wgRow.Cells.GetNamedItem(col.Name).Value.ToString();
            }
        }

        e.Table.Rows.Add(wgRow);
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Please give it a spin and let us know how it works in your end.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Export to Excel in Webgrid not exporting All the Records in virtual Mode </title><link>http://www.intersoftsolutions.com/Community/Lounge/Export-to-Excel-in-Webgrid-not-exporting-All-the-Records-in-virtual-Mode/</link><pubDate>Wed, 30 Nov 2016 12:35:35 GMT</pubDate><dc:creator>sreeji.vijayan@pcctg.com</dc:creator><description>&lt;div id="ctl00_ctl00_ctl00_ctl00_a_b_c_e_content0" style="margin-bottom: 10px;" class="postcontent"&gt;&lt;p&gt;Hello Intersoft,&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;We are using Intersoft Grid Version 9.0.7200.1. We are facing an issue with Export to excel feature,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;The Export to excel feature is not exporting all the records, it is exporting only 100 rows when we set the&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;PagingMode="VirtualLoad" and VirtualPageSize="100" and&amp;nbsp;PagingExportMode="ExportAllData".&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Please let us know how to export all the records to Excel ASAP.&lt;/p&gt;&lt;p&gt;Thank You&lt;/p&gt;&lt;/div&gt;</description></item></channel></rss>