﻿<?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 - Grid export error when groups are created in code behind</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Grid-export-error/</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>Grid export error when groups are created in code behind</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Grid-export-error/</link><pubDate>Thu, 25 Nov 2010 23:43:26 GMT</pubDate><dc:creator>niven</dc:creator><category>WebGrid</category><category>error</category><category>export</category><category>dynamically created groups</category><description>&lt;p /&gt;&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;Hello,&lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;I have attached a simple sample of mine. Let me know if the sample works well on your side or not.&lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;If my sample did not replicate your current issue, please change my sample until it can replicate your issue.&lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;Hope this helps.&lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;Thank you and have a nice weekend.&lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Grid export error when groups are created in code behind</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Grid-export-error/</link><pubDate>Thu, 25 Nov 2010 13:37:23 GMT</pubDate><dc:creator>Mladen.maras@combis.hr</dc:creator><category>WebGrid</category><category>error</category><category>export</category><category>dynamically created groups</category><description>&lt;p&gt;We are using WebUI Studio 2009 R2 with all fixes.&lt;/p&gt;
&lt;p&gt;We have grid with 10 columns defined on the aspx page. First 2 columns have &lt;strong&gt;Visible="false"&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In code-behind, in the &lt;strong&gt;WebGrid1_InitializeLayout&lt;/strong&gt; event, 2 groups are created and their ColumnMember are those 2 hidden columns.&lt;/p&gt;
&lt;p&gt;When I select Export on the grid, an alert is shown with text - Column "Column1" not found.&lt;/p&gt;
&lt;p&gt;I tried to set those columns visible in the &lt;strong&gt;WebGrid1_Export&lt;/strong&gt; :&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e)
        {
            e.Table.Columns.GetNamedItem("Column1").Visible = true;
        }&lt;/pre&gt;

&lt;p&gt;If I try to export, another alert is shown with text - Object reference not set to an instance of an object.&lt;/p&gt;
&lt;p&gt;On the other hand, if groups are defined on the aspx page in the &amp;lt;GroupedColumns&amp;gt; section of the grid, everything works fine.&lt;/p&gt;
&lt;p&gt;We have around 10&amp;#43; different pages with grid. Each page has grid that generates groups based on UrlParameter and different UrlParameter values can be between 2 and 8 per page. That means that those 10&amp;#43; pages wih dynamically generated groups replace between 40 and 60 statically defined aspx pages. &lt;/p&gt;
&lt;p&gt;Is there a way to make export work with groups defined in code-behind?&lt;/p&gt;</description></item></channel></rss>