﻿<?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 - Exporting to XML</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Exporting-to-XML/</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>Exporting to XML</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Exporting-to-XML/</link><pubDate>Mon, 05 Oct 2009 12:08:40 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Yudi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Your first example of changing a column name works, although you can't add a space, like "Carrier State" the export replaces the space with "_0020_".&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In the second example in changing the Text value doesn't work.   You can change the Value but not the Text that gets exported.  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Exporting to XML</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Exporting-to-XML/</link><pubDate>Mon, 05 Oct 2009 10:40:44 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Thanks, I will try out as soon as I can and let you know of any problems.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;</description></item><item><title>Exporting to XML</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Exporting-to-XML/</link><pubDate>Sun, 04 Oct 2009 23:12:46 GMT</pubDate><dc:creator>yudi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;WebGrid has “OnExport” server side event. You can handle the OnExport server side event, write customized exporting codes and set the event’s ReturnValue to false for cancelling default process. You can also have your scenario implemented by using this server side event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please try to use following code in order to change the name of the fields that get exported (in the following sample, I use “Shippers” table in Northwind.mdb file as the reference). The sample below shows how to change the “CompanyName” field into “Company”.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e)
{
    e.Table.Columns.GetNamedItem("CompanyName").Name = "Company";
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;In order to change a value of field, please try to use following code. The sample below shows how to change the value of a cell, from “United Package” into “United Package Service”.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e)
{
    e.Table.Rows[1].Cells.GetNamedItem("CompanyName").Text = "United Package Service";
}&lt;/pre&gt;
&lt;span style="font-family: segoe ui; color: #1f497d"&gt;&lt;/span&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Exporting to XML</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Exporting-to-XML/</link><pubDate>Fri, 02 Oct 2009 12:31:34 GMT</pubDate><dc:creator>John.Bonin@dot.gov</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;  I am exporting my grid to an XML file and was wondering if there is a way to change the name of the fields that get exported.  For example, on the Grid I have a column defined as:&lt;/p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;
&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;ISWebGrid&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;WebGridColumn&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; &lt;/span&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;Caption&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;="State"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; &lt;/span&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;DataMember&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;="CARRIER_STATE"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; &lt;/span&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;Name&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;="CarrierState" 
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;&lt;span style="font-size: 13px; color: #ff0000"&gt;Width&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;="50px"&amp;gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;ISWebGrid&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;&lt;span style="font-size: 13px; color: #a31515"&gt;WebGridColumn&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; 

&lt;p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;When it is exported to XML the Field name is CARRIER_STATE, I would like it to use the Caption name of "State" instead.  Is this possible?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;Also I would like to change a value of the field when it gets exported.  For example a field in the database has the  value of -1 but when I display it in the Grid, I change it to "**", but the export uses -1 but I want to use "**".  Is this possible? &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;Thanks&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;John&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>