Combo Box Databinding

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 18-Apr-2013 15:58:13   

LLBLGen 4.0 LLBLGen Runtime Framework .NEt Framework 4.0 C# Windows Application MYSQL 5.x

Hello,

I am trying to load data in the combo box by data binding.

Design: CmbCountryID - I Created Combobox Added datasource bndsrccountry to Cmbcountryid Added binding source by name bndsrccountry. Added countryCollection as data source. In databinding selected item - added bndsrccountry - Description In databinding value Member - added bndsrccountry - Countryid

Now this is my code Filter.Clear(); Filter.Add(CountryFields.Flag == VariableClass.Flagvalid); ISortExpression sort = new SortExpression(CountryFields.Description | SortOperator.Ascending); _country.GetMulti(Filter, 0, sort, null, null, null, 0, 0); cmbcountryid.DataSource = bndsrccountry;

But when I run nothing comes up in combo box !

Wondering why ?

Also tried adding these 2 lines cmbcountryid.DisplayMember = "Description"; cmbcountryid.ValueMember = "CountryID"; cmbcountryid.Refresh();

Query generated executes in SQL with data

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 18-Apr-2013 18:17:31   

Please confirm that the bindingDatasource has the _country as it's datasource. Also after the GetMulti() check to see whether the _country collection got populated with data.

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 19-Apr-2013 07:23:46   

Walaa wrote:

Please confirm that the bindingDatasource has the _country as it's datasource. Also after the GetMulti() check to see whether the _country collection got populated with data.

Thanks. Had through dropping binding source in GUI design along with entitycollection and then setting binding source in design mode to combo would work !

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Apr-2013 08:16:29   

Did it work? (Walaa's suggestion)?

David Elizondo | LLBLGen Support Team
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 19-Apr-2013 09:48:34   

daelmo wrote:

Did it work? (Walaa's suggestion)?

Yes Sir It did work