How to Limit selected column with collection

Posts   
 
    
dianec
User
Posts: 11
Joined: 16-Mar-2007
# Posted on: 16-Mar-2007 20:34:21   

I am trying to bind a data query with a datagrid, using collectionclasses, and relationsclasses, and entityclasses. However, I have not found an easy way to limit columns of the result set before binding it to datagrid. The result set is from multiple entityclasses.

Please advise the best way to limit selected columns. thanksconfused confused

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 16-Mar-2007 21:05:55   

typed list, dynamic list, or project a resultset onto a collection. there is no defualt option to limit selected fields or prefetchs for an entity.

dianec
User
Posts: 11
Joined: 16-Mar-2007
# Posted on: 16-Mar-2007 21:19:00   

Can you give me some code sample to use eith typedlist or dynamic list. thanks

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 16-Mar-2007 21:39:30   

a typed list is created within the llbl designer. a typedlist inherits from DataTable. it's a strongly typed data table. so all the rules apply. I dynamic list is just like a typed list, but it's created at design time, so it's not strongly typed. here is an example of a typedlist

MyTypedList myList = new MyTypedList();
adapter.FetchTypedList(myList);

here is an example of a dynamic list

ResultSet fields = new ResultSet(2);
fields.DefineField(MyFields.Column1, 0);
fields.DefineField(MyFields.Column2, 1);

DataTable tbl = new DataTable();
adapter.FetchTypedList(fields, tbl);

there are a number of overloads for FetchTypedList() which allow for sorting, filtering, grouping, x number of rows...

The documentation also has examples of how to do this.

dianec
User
Posts: 11
Joined: 16-Mar-2007
# Posted on: 16-Mar-2007 22:01:43   

Can you please give me the link to the related documentation (or name of the document). thanks

dianec
User
Posts: 11
Joined: 16-Mar-2007
# Posted on: 16-Mar-2007 22:10:19   

can you give me the link and document name??? thanks

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 17-Mar-2007 01:21:54   

It's the help document. open llbl gen click Help>Open Help in Browser search for typedlist and dynamic list.