Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
UltraComboEditor and List<T> as DataSource
posted

I created a small helper class:

    public class ComboHelper
    {
        public int ValueMember;
        public string DisplayMember;
    }

I want to create a List<ComboHelper> and bind that to a UltraComboEditor control:

List<ComboHelper> comboDataSource = new List<ComboHelper>();
ComboHelper comboHelper = new ComboHelper { ValueMember = 1, DisplayMember = "ID" };
comboDataSource.Add(comboHelper);
comboHelper = new ComboHelper { ValueMember = 2, DisplayMember = "Collateral" };
comboDataSource.Add(comboHelper);

cmbFilter.DataSource = comboDataSource;
cmbFilter.DisplayMember = "DisplayMember";
cmbFilter.ValueMember = "ValueMember";

I run the app and nothing shows in the combo box.  What am I missing? [I know it's something simple...still trying to get the hang of these controls]