How to Create Empty EntityCollection?

Posts   
 
    
pandu avatar
pandu
User
Posts: 86
Joined: 18-May-2006
# Posted on: 21-Nov-2006 06:53:08   

This is for a Webapp.

My Entity has:

Item ItemColor ItemSize ItemPrice ItemAmount

I need to bind a entitycollection based on this entity to a grid, but without the ItemSize Field. In other words, binding Entity Collection must be grouped by Item, ItemColor.

Is this possible? If not, can I use Dynamic List? This is for editing purpose. So, I need to convert the Dynamic List to EntityCollection before binding to the Grid.

Any suggestions?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 21-Nov-2006 09:20:32   

pandu wrote:

This is for a Webapp.

My Entity has:

Item ItemColor ItemSize ItemPrice ItemAmount

I need to bind a entitycollection based on this entity to a grid, but without the ItemSize Field. In other words, binding Entity Collection must be grouped by Item, ItemColor.

Is this possible? If not, can I use Dynamic List? This is for editing purpose. So, I need to convert the Dynamic List to EntityCollection before binding to the Grid.

Any suggestions?

You just want to not show a single column or you want to group data together? (in which case you can't edit it, you can't edit aggregated data, as it's aggregated). So I assume you just want to edit entities but not show that single column. That's simple: setup the grid with the webform designer and an llblgenprodatasource(2) control and then edit the columns in the grid. There you can remove a column from the grid which then won't show up simple_smile

Frans Bouma | Lead developer LLBLGen Pro
pandu avatar
pandu
User
Posts: 86
Joined: 18-May-2006
# Posted on: 21-Nov-2006 13:16:16   

It does work Frans.

The problem is that I need to edit this Dynamic List... (Oh.. I can hear your "You cannnn't do that.. ".. simple_smile )

What If I need to edit the Dynamic List? How do I convert this to an EntityCollection? So that, i can bind it to a Grid to get the Batch Input. In other words, It won't save to the real table until I click a Save All Button.

Hope I didn't confuse you. simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 21-Nov-2006 14:03:49   

pandu wrote:

It does work Frans.

The problem is that I need to edit this Dynamic List... (Oh.. I can hear your "You cannnn't do that.. ".. simple_smile )

What If I need to edit the Dynamic List? How do I convert this to an EntityCollection? So that, i can bind it to a Grid to get the Batch Input. In other words, It won't save to the real table until I click a Save All Button.

Hope I didn't confuse you. simple_smile

Grouped data (created with a group by clause) is data which is added/subtracted etc.. To edit that you need to convert the data back to 1 or more entities, which always has to be done in custom code but again: it doesn't make any sense. It's like altering an Order total and then saving the changed total back into 5 order row entities.

Editing a non-grouped set of data can be done in entities (prefered) or by fetching the entities afterwards based on the PK's in the list. Then set the values in the entities loaded and save them again.

Frans Bouma | Lead developer LLBLGen Pro