By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,166 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,166 IT Pros & Developers. It's quick & easy.

databinding error - business layer props to my webcontrol

P: n/a
I create a business layer object w/public properties. the db access is also
done from here. Its here I set the property values as well.

So when my UI request is made all values are saved to the viewstate and
loaded. Then I want to bind my object to a webcontrol:

myDatagrid.Datasource = myBusinessObj;
myDatagrid.Databind();

This is where my error occurs. Some error regarding IEnumerable and
IEnumerator.

any ideas? thanks.


Feb 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
mgonzales3 wrote:
I create a business layer object w/public properties. the db access
is also done from here. Its here I set the property values as well.

So when my UI request is made all values are saved to the viewstate
and loaded. Then I want to bind my object to a webcontrol:

myDatagrid.Datasource = myBusinessObj;
myDatagrid.Databind();

This is where my error occurs. Some error regarding IEnumerable and
IEnumerator.


The binding you want to perform is called 'complex' binding, which
means that an IListSource or IEnumerable object, containing other
objects, is bound to a grid/list like control. So binding a single
object to a grid isn't possible. Store your business object in an
arraylist and bind that to the grid.

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.