Hastable in EntityCollection

Posts   
 
    
Austinn
User
Posts: 38
Joined: 25-Aug-2008
# Posted on: 03-Jul-2010 16:36:17   

Hello, is it possible to customize the generated code that when I get the entitycollection<t> object. The adaptor some how generates the hastable as well.

Dont know it is possbile or not. If possible please guide me.

Thanks and regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 04-Jul-2010 11:47:39   

What kind of hashtable?

Frans Bouma | Lead developer LLBLGen Pro
Austinn
User
Posts: 38
Joined: 25-Aug-2008
# Posted on: 04-Jul-2010 15:09:46   

actually. In my database there are few tables which holds static information. Like InvoiceStatus{Initiated, Approved, Paid etc} Customer Type{Retail or Corporate}

We are using Devexpress components. If we will be able to get statuses as hashtable then it will be easy to bind the devexpress comboboxes. Because currently when I am using EntityCollection<CustomerType> object, from the databse I am able to load all the rows from CustomerType table into EntityCollection<CustomerType> successfully. But dont know how to bind this collection to the Devexpress combobox.

Hope I am able to define what I am looking for.

Regards

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Jul-2010 00:31:07   

ComboBoxEdit is not databind oriented. Instead use the LookUpEdit control. Here is how to configure it and populate it in runtime. You don't need a Hashtable for this.

  1. Drag&Drop your LookUpEdit control.
  2. Edit columns and add just that columns you want to be displayed. In the FieldName write the name of the field in the Entity. For example StatusName.
  3. In the code. wherever you want (Load, some buttons's Click, etc) add this code:
DataAccessAdapter adapter = new DataAccessAdapter();
EntityCollection<InvoiceStatusEntity> statusDataSource = new EntityCollection<StatusEntity>();          
adapter.FetchEntityCollection(statusDataSource, null);

myLookUpCombo.Properties.DataSource = statusDataSource;     
myLookUpCombo.Properties.DisplayMember = StatusFields.StatusName.ToString();
myLookUpCombo.Properties.ValueMember = StatusFields.StatusId.ToString();
David Elizondo | LLBLGen Support Team