Hibernate version: 1.02
Hi Guys,
Just need a little help with Nhibernate and Databinding with Windows Forms 2.0. In my XML file I have a one to many bag for a class. There is no lazy initialization. When I get the list for that type, the bag is populated properly.
The issue is that if the bag is empty with count=0 I have a databinding error:
"Cannot bind to the property or column PROPERTYNAME on the DataSource. Parameter name: dataMember".
I believe the reason this happens is because the bag is not typed and when there are no rows, it cannot find the propery and column within the bag. On the other hand, if the bag has count > 0, there are no issues, it binds perfectly.
Now, is there a way, I can say in the mapping file that if the bag count = 0 , then do not set the object IList property. What is the best way to fix this?
Regards,
Mike
|