DataBinding issue

Posts   
 
    
zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 11-Mar-2013 01:13:06   

Hi, I've ran into a strange problem with databinding in windows forms when an entity inherits from another one.

I have a BindingSource with datasource an inherited entity. I then have a grid which is bound to the bindingsource. When I try to select the field mapped to a column in the grid designer, I get this error:

BindingSource unable to create list based on the Type specified in the DataSource property

I thought that maybe this is happening because the inherited entity doesn't have a parameterless constructor but it does.

With standard entities which do not inherit from another one the problem is not there.

I'm using LLBLGen Pro 3.1 March 12th, 2012 and Visual Studio 2012 and the grid in question is DevExpress XtraGrid.

Thanks for the help

zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 11-Mar-2013 01:37:30   

I partially solved the issue.

In one case I have a validator which is created when the associated entity is created and it was failing at design time as it was trying to access an unavailable resource.

However, having said this, in another case I'm getting this issue because Visual Studio is trying to create a list of entities which are related to another one, but these are Abstract and so do not have a parameterless constructor. Visual Studio obviously fails.

So, a question/suggestion: would it be possible for LLBLGen entities to detect if they have been instantiated at design time and load only necessary stuff in this conext?

Thanks again

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Mar-2013 04:17:32   

It's the first time I hear about this happening. I don't think it's an LLBLGen error, but let's take a closer look.

  • Could you please paste the full designer error information? Or that error message is all VS shows?
  • Does it happen if you create a normal Grid (so no DevExpress)?
David Elizondo | LLBLGen Support Team