databinding

Posts   
 
    
Baobab
User
Posts: 7
Joined: 29-Mar-2005
# Posted on: 01-Apr-2005 11:34:14   

Hej,

I am lokking for a way to bind data from a single entity to a datagrid using the adatper template!

Any ideas?

Thanx

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 01-Apr-2005 12:07:20   

That's complex databinding and that always needs an IList typed container, so you should add the entity to an EntityCollection instance and bind that EntityCollection to the grid simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Baobab
User
Posts: 7
Joined: 29-Mar-2005
# Posted on: 01-Apr-2005 13:06:07   

I would really appreciate a small exemple, illustrating this complex databinding...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 01-Apr-2005 13:27:50   

Baobab wrote:

I would really appreciate a small exemple, illustrating this complex databinding...

Complex databinding is the term for binding to a grid. Simple databinding is the term for binding to a textbox' property for example simple_smile These are the terms used by Microsoft to distinguish the 2.

Simply do: EntityCollection col = new EntityCollection(new CustomerEntityFactory()); col.Add(myCustomerToBind); myGrid.DataSource = col;

Frans Bouma | Lead developer LLBLGen Pro
Baobab
User
Posts: 7
Joined: 29-Mar-2005
# Posted on: 01-Apr-2005 13:41:16   

where myCustomerToBind is...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 01-Apr-2005 14:24:14   

Baobab wrote:

where myCustomerToBind is...

errr... the entity you want to bind to the grid? (I used that as an example)

It might be good to look up complex databinding and simple databinding in the .NET documentation.

Frans Bouma | Lead developer LLBLGen Pro