Error when binding to generic collection (IEnumerable)

3 replies. Last post: January 26, 2010 8:25 PM by Andi Santoso
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Darren BuddMember

Hi,

I am getting an "unsupported data source type" error when binding to a generic collection of IEnumerable<T>.  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:

 

 protected void grd_Faqs_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
    {
        IEnumerable<Faq> faqs = _service.ListFaqs();

        grd_Faqs.DataSource = faqs;
        grd_Faqs.DataBind();
    }
All times are GMT -5. The time now is 3:21 AM.
Previous Next