TC Power

TC Power

  • NA
  • 6
  • 0

Populating a ComboBox from a collection

Aug 14 2008 11:42 AM

I would to populate a country combo box using a collection. The code for the collection is below:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace BUI

{

public class CountryCollection : BUIBaseCollection<Country>

{

public static CountryCollection FetchList()

{

CountryCollection obj = new CountryCollection();

obj.MapObjects(new DAL.Country().FetchList());

return obj;

}

}

}

Fetchlist is a stored procedure that returns all records in a table. My problem is to populate my combo box I am using this code:

this.cmbCountry.ItemsSource = BUI.CountryCollection.FetchList();

and instead of displaying the items in the table, it is displaying:

BUI.Country

BUI.Country

BUI.Country

Thanks

TC


Answers (1)