﻿<?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 - Error when binding to generic collection (IEnumerable)</title><link>http://www.intersoftsolutions.com/Community/WebGrid/ienumerablebinding/</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>Error when binding to generic collection (IEnumerable)</title><link>http://www.intersoftsolutions.com/Community/WebGrid/ienumerablebinding/</link><pubDate>Tue, 26 Jan 2010 20:25:22 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 8pt; "&gt;Hi Darren,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Glad to hear that your problem has been solved. Please do not hesitate to ask if you have any other questions. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Error when binding to generic collection (IEnumerable)</title><link>http://www.intersoftsolutions.com/Community/WebGrid/ienumerablebinding/</link><pubDate>Tue, 26 Jan 2010 07:29:49 GMT</pubDate><dc:creator>theDiv</dc:creator><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks for that, its sorted my problem. Seems I was just taking the wrong approach to data binding!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks again.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Darren&lt;/p&gt;</description></item><item><title>Error when binding to generic collection (IEnumerable)</title><link>http://www.intersoftsolutions.com/Community/WebGrid/ienumerablebinding/</link><pubDate>Tue, 26 Jan 2010 01:51:35 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p class="MsoNormal" style="margin: 7.5pt 0in"&gt;&lt;span style="font-family: 'lucida sans unicode','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'times new roman'"&gt;&lt;span style="font-size: 8pt"&gt;Hi Darren,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0in"&gt;&lt;span style="font-family: 'lucida sans unicode','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'times new roman'"&gt;&lt;span style="font-size: 8pt"&gt;     I am not able to replicate your issue since I do not have your IEnumerable data. However, from what I see on your code, we cannot use &amp;lt;grid&amp;gt;.DataSource in InitializeDataSource. What you might want to do is to write it like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; background: #fffce1; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-family: 'courier new'; font-size: 9pt; mso-fareast-font-family: 'times new roman'"&gt;&lt;span style="mso-tab-count: 1"&gt;         &lt;/span&gt;e.DataSource = faqs;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0in"&gt;&lt;span style="font-family: 'lucida sans unicode','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'times new roman'"&gt;&lt;span style="font-size: 11pt"&gt;    &lt;/span&gt;&lt;span style="font-size: 11pt"&gt;&lt;span style="font-size: 9pt"&gt;&lt;span style="font-size: 8pt"&gt;And, as well, you do not need to do the DataBind() anymore. I hope it helps you and please let me know if you have any other questions. Thank you.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0in"&gt;&lt;span style="font-family: 'lucida sans unicode','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'times new roman'"&gt;&lt;span style="font-size: 8pt"&gt;Best Regards,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0in"&gt;&lt;span style="font-family: 'lucida sans unicode','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'times new roman'"&gt;&lt;span style="font-size: 8pt"&gt;Andi Santoso&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Error when binding to generic collection (IEnumerable)</title><link>http://www.intersoftsolutions.com/Community/WebGrid/ienumerablebinding/</link><pubDate>Mon, 25 Jan 2010 14:55:57 GMT</pubDate><dc:creator>theDiv</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am getting an "unsupported data source type" error when binding to a generic collection of IEnumerable&amp;lt;T&amp;gt;.  The problem occurs when I bind from within the InitializeDataSource event, however, the grid does bind correctly when  I place the same code outside of this event and call it explicitly.  Is this approach not recommende?  Here is my binding code:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre&gt; protected void grd_Faqs_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
    {
        IEnumerable&amp;lt;Faq&amp;gt; faqs = _service.ListFaqs();

        grd_Faqs.DataSource = faqs;
        grd_Faqs.DataBind();
    }&lt;/pre&gt;</description></item></channel></rss>