iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
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(); }
Hi Darren,
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 <grid>.DataSource in InitializeDataSource. What you might want to do is to write it like this:
e.DataSource = faqs;
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.
Best Regards,
Andi Santoso
Hi Andi,
thanks for that, its sorted my problem. Seems I was just taking the wrong approach to data binding!
thanks again.
Darren
Glad to hear that your problem has been solved. Please do not hesitate to ask if you have any other questions. Thank you.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname