read-only list that will be filtered by different predicates

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 19-Apr-2007 21:31:17   

version 1.0.2005.1 final (self-servicing) VS2005 asp.net 2.0


hiya,

I need to create a read-only list that will be filtered by different predicates. The list will come from a single table, but won't use all of the fields, only some of them. If I'm right, then I should create a typed list, which contains the fileds that I need from the entity?

many thanks,

yogi

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Apr-2007 10:01:08   

A TypedList or a DynamicList are your options.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 20-Apr-2007 13:16:04   

cheers Walaa,

I am using a typedList.I now find that I need to use a relation to another table.I have looked and I don't think that it's possible to create the relation via the designer.

I don't know if it's possible to use the relations with typedLists, but that's what i'd like to do. (please stop me if it isn't possible)

The typeList is made up of: 1) fields from the "cskStoreProduct" table 2) a mapped field in "cskStoreImage" table "imageFile"

cskStoreProduct productId PK

cskStoreImage image ID PK productId FK

I want to grab the "imageFile" field from the cskStoreImage table and use it as if it is part of the original typedList.

dalHamilton.TypedListClasses.TListPromoProductsTypedList tListPromoProducts = new TListPromoProductsTypedList();
tListPromoProducts.Fill() ; 

RelationCollection relationsToUse = new RelationCollection(); 
   relationsToUse.Add(dalHamilton.EntityClasses.CskStoreProductEntity.Relations.CskStoreImageEntityUsingProductId);

Is the above possible? Please let me know if I can clarify anything.

cheers,

yogi

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Apr-2007 16:26:00   

Did you check the following section in the manual: "Designer -> Adding custom relations"?

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 20-Apr-2007 19:06:11   

hiya Walaa,

It was actually a field that I needed to add.LlblGenPro picked up the relationship automatically.I added the cskStoreImage entity to the typedList and then selected the field that I needed.Problem solved.

thanks,

yogi