﻿<?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 - WebGrid Enterprise - Export Events</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Export-Events/</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 Events</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Export-Events/</link><pubDate>Thu, 22 Oct 2009 23:14:44 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The “OnExport” and “OnExportCompleted” server side event occurs when exporting data from WebGrid is performed. The “ExportGrid()” method that uses in the “ProgrammaticExportServerSide.aspx” sample file will export datasource with current grid’s layout to the other formats.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I suggest you to set the caption of the column before invoking “ExportGrid()” method and reset it afterward.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    WebGrid1.RootTable.Columns.GetNamedItem("Address").Caption = "My Address"
    Dim file As String = WebGrid1.ExportGrid(New ISNet.WebUI.WebGrid.DynARInfo("excel", Server.MapPath("./TempReports/"), "WebGridToExcel")) ' export grid data
    WebGrid1.RootTable.Columns.GetNamedItem("Address").Caption = "Address"
    fileLabel.Text = "File exported to : " &amp;amp; file
    fileLabel.Text &amp;amp;= "&amp;lt;br/&amp;gt;Click here to open the file : &amp;lt;a href = 'TempReports/WebGridToExcel.xls'&amp;gt;[WebGrid to Excel]&amp;lt;/a&amp;gt;"
End Sub&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this help.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Export Events</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Export-Events/</link><pubDate>Thu, 22 Oct 2009 11:45:10 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Here we go again...&lt;/p&gt;
&lt;p&gt;I am using the Visual Basic sample ProgrammaticExportServerSide.  I added an WebGrid1_Export event and using the following code, changed the Column caption from "Address" to "My Address".&lt;/p&gt;&lt;pre&gt;With e.Table.Columns
       .GetNamedItem("Address").Caption = "My Address"
End With&lt;/pre&gt;
&lt;p&gt;The reason,  I want to change the header text in the generated output only and want it to be "Address" after the export is complete.  So I added a WebGrid1.ExportCompleted event and reveresed the code:&lt;/p&gt;&lt;pre&gt;With WebGrid1.RootTable.Columns
       .GetNamedItem("Address").Caption = "Address"
End With&lt;/pre&gt;
&lt;pre&gt;I set breakpoints on each event and ran the program.  The ExportCompleted Event never runs.  When is this event suppose to execute?  And is there a way I can change column headers in the export only without having to go through the above mess?&lt;/pre&gt;&lt;pre&gt;Also I am Exporting to a TEXT file.&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
</description></item></channel></rss>