EntityCollections

Posts   
 
    
Heike
User
Posts: 14
Joined: 31-Jan-2006
# Posted on: 22-Jun-2006 15:32:45   

Instead of binding a whole collection to a grid, I want selected fields to be bound. E.g. Northwind database/ Order Details ( havin 5 rows / fields) I want to bind only 3 fields.

How is that been done. flushed I couldn't find a hint in your samples code

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Jun-2006 16:30:52   

It dependsd if you are developing a web or windows application.

In windows app: define tableStyels and GridColumnStyles ofr the datagrid in hand. In Web app: you should manually define asp:BoundColumn(s) inside the <Columns> tag or visually by using the columns collection property of the datagrid.

You can also go for a typedList or dynamicList instead of using the entityCollection. Where you can select specific fields to be added to the lists.

Heike
User
Posts: 14
Joined: 31-Jan-2006
# Posted on: 22-Jun-2006 18:45:34   

Sorry, I didn't describe correctly.

I am developing a windows applikation. All what i need is 3 columns out of n, which are in the collection. Is there any way as a sort of SELECT col1, col2, col3 FROM Collection disappointed

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 23-Jun-2006 08:28:11   

All you have to do is to work with the Grid's "TableStyles" property, define a tableStyle and add the columns (which map to fields) you want, you may choose not to add a field or to add it and have it hidden.

Please refer to the following threads:

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=285 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3779 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6382