change the column order in an entityCollection

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 30-May-2006 17:20:23   

version 1.0.2005.1 final (self-servicing) VS2005 winforms


Hiya,

I know that you can edit the columns in an entityCollection when it's bound to a datagridView at design time.

Is it possible to do the same in code / in the LlblgenPro designer?

many thanks,

yogi

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 31-May-2006 02:25:18   

You can't hide fields for an entity collection in the designer like you would for a datagrid, but you can make typedlist that will only contain the fields you would want to display.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 31-May-2006 09:57:34   

You can also map another entity on the same table and remove fields from that entity from the list of fields. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 31-May-2006 23:12:27   

hiya,

As usual with me, there's a twist :-(

the datagridView contains a column "productConditionId", I want to remove this column, and simply keep the lookup column ("productConditionName"), that I added in the LlblGenpro designer.

The problem: I have a combobox whose selected item is used as a predicate for the entityCollection.


TblReturnProductConditionEntity selectedCondition = (TblReturnProductConditionEntity)cboReturnProductCondition.SelectedItem;
            filtReturnProductCondition.Add(PredicateFactory.CompareValue(TblReturnProductsFieldIndex.ReturnProductCondtionId, ComparisonOperator.Equal, selectedCondition.ReturnProductCondtionId));        

            tblReturnProductsCollection1.GetMulti(filtReturnProductCondition);      

So, how can I:

a) hide the "productConditionId" column in the datagridView? b) yet STILL use this field as a predicate?

many thanks,

yogi

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 01-Jun-2006 02:50:46   

Have you tried setting the visible property of the productConditionId column to false? This column would then still be available, but not shown to your users.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 01-Jun-2006 10:21:34   

hiya Brian,

the problem is that the entityCollection is bound to the datagridView in code, not via the designer.

Any ideas? thanks,

yogi

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 01-Jun-2006 13:05:11   

use a tablestyle which you design in the grid, or through code (though I'd use the grid's designer) and in there make sure the columns are in the right order, and hide columns there.

Frans Bouma | Lead developer LLBLGen Pro
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 01-Jun-2006 16:56:16   

right,

This might sound like a stupid question, but how do i get access to a winforms datagridView "tableStyle" at design time?

Obviously, the datagridView doen't contain any columns at design-time, as it gets bound at run-time.

Many thanks,

yogi

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 01-Jun-2006 17:11:17   

Just add a collection to the form and use that to design the grid. You can bind any collection at runtime simple_smile

Frans Bouma | Lead developer LLBLGen Pro
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 02-Jun-2006 10:35:25   

hiya,

you're right, I don't know why I ever thought I needed to databind at runtime. ta,

yogi