Databinding using EntityCollection does not work

Posts   
 
    
shuffles
User
Posts: 1
Joined: 12-Mar-2013
# Posted on: 12-Mar-2013 22:27:28   

Hi,

I have generated a LLBLGen Pro Runtime source code using Adapter templates in LLBLGen Pro v3.5. I am trying to have my C# grid control (I am usnig DevExpress) bind to an entity.

According to your documentation (http://www.llblgen.com/documentation/3.5/LLBLGen%20Pro%20RTF/hh_start.htm), I am supposed to create an entity collection object and have my binding source's DataSource point to the entity collection. When I tried this, I wasn't successful. However, when I tried pointing the binding source's DataSource directly to an entity (e.g. EMRep.DataEntities.EntityClasses.ApplicationStateEntity), it's able to successfully bind to my grid control.

Am I doing something wrong here? I am using .Net 4.0, vs2010.

Thanks, Shuffles

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Mar-2013 06:52:33   

Hi Suffles,

You are not wrong. What this documentation section says is:

To setup databinding at design time, it's recommended you use the Data sources feature in Visual Studio.NET. Create a Data Source based on an entity type in the generated code, e.g. CustomerEntity. Setup databinding using that data source, e.g. through dragging a BindingSource onto your form. When you set the DataSource property of that BindingSource to the Data Source you created of the entity type, you can design the control bound to the BindingSource. At runtime, set the DataSource property of the BindingSource instance to a fetched EntityCollection<T> instance. This will make sure the data shows up in the control bound to the BindingSource.

... so, for Design-time databinding, use an entity type, so you can design the columns you want, etc. At runtime, you assign an instance of EntityCollection<T> to the corresponding DataSource.

David Elizondo | LLBLGen Support Team