Databing with devexpress components...please help

Posts   
 
    
Austinn
User
Posts: 38
Joined: 25-Aug-2008
# Posted on: 03-Jul-2010 13:49:24   

Hello, I am using Devexpress components on winforms. I want to load all the records in CustomerType table in an EntityCollection object and below is the code I am using. If I am wrong please guide me.

EntityCollection<CustomerTypeEntity> customerTypeCollection = 
                new EntityCollection<CustomerTypeEntity>(new  CustomerTypeEntityFactory());     

            DataAccessAdapter dataAccessAdapter = new DataAccessAdapter();
            dataAccessAdapter.FetchEntityCollection(customerTypeCollection, null);

The above code seems working fine and loaded some objects inside the collection. Now the issue is that how can I bind my returned collection of CustomerType to the ComboBox.

The CustomerType table is having 2 fields. CustomerTypeId, CustomerType. Now in the combobx I want to display the Customer Type which is a friendly description and in the value I want to use the CustomerTypeId. Please help how to achieve this.

Thanks and regards

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Jul-2010 19:55:23   

You should configure it as if it would be a default winforms combobox. Please read Databinding with Winforms.

Also recommended to download the winforms examples (http://llblgen.com/pages/examples.aspx).

David Elizondo | LLBLGen Support Team
Austinn
User
Posts: 38
Joined: 25-Aug-2008
# Posted on: 02-Oct-2010 01:07:28   

No dear, It is not a normal windows component. Is there any body who can provide me some example or way to bind the DevExpress combobox with the EntityView2

Regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39905
Joined: 17-Aug-2003
# Posted on: 02-Oct-2010 16:17:59   

See: http://community.devexpress.com/forums/p/56756/191444.aspx

ComboBoxEdit doesn't support binding, it has an Items collection (.Properties.Items) to which you can add elements to, but if you want to show a combobox with data from a multi-column set, it's not directly bindable.

Frans Bouma | Lead developer LLBLGen Pro
Austinn
User
Posts: 38
Joined: 25-Aug-2008
# Posted on: 02-Oct-2010 22:11:06   

Thanks otis, you are a big help man...like others on this forum.

Regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39905
Joined: 17-Aug-2003
# Posted on: 03-Oct-2010 15:09:18   

Austinn wrote:

Thanks otis, you are a big help man...like others on this forum. Regards

No problem.

Frans Bouma | Lead developer LLBLGen Pro