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
615
How to bind an UltraComboEditor to a dynamic list?
posted

How to do something like this with an UltraComboEditor? listBox is a System.Windows.Forms.Listbox

List<dynamic> dynList = new List<dynamic>() {
            new {Id = 1, Name = "Elevator" },
            new {Id = 2, Name = "Stairs" }
};
listBox.DataSource = dynList;
listBox.DisplayMember = "Name";
listBox.ValueMember = "Id";

If listBox is an UltraComboEditor an exception is trown:

System.NotSupportedException was unhandled by user code   HResult=-2146233067   Message=The ValueList associated with the control does not support DataBinding.   Source=Infragistics4.Win.UltraWinEditors.v12.2