Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you need DevEx control that behaves like winforms standard combobox you should use <a href="http://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraEditorsLookUpEdittopic" rel="nofollow">LookupEdit</a> control. </p> <p>From <a href="http://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraEditorsComboBoxEdittopic" rel="nofollow">ComboBoxEdit documentation</a>: </p> <p><em>ComboBoxEdit combines the functionality of a single-line text editor with the dropdown window.<br> ComboBoxEdit items can be of any type. In the dropdown window and edit box, <strong>items are represented by their display texts (strings returned by the item's ToString method)</strong>. <strong>When you select an item from the dropdown, a corresponding object from the item collection is automatically assigned to the SelectedItem property.</strong> This property value matches the edit value available via the EditValue property.</em></p> <p>So, in ComboBoxEdit you can't have display and value member, it just displays string representations of items. </p> <p><strong>EDIT</strong>(bind dictionary to LookupEdit): </p> <pre class="lang-cs prettyprint-override"><code>LookUpEdit lookupEdit = new LookUpEdit(); Dictionary&lt;string,string&gt; dic = new Dictionary&lt;string,string&gt;(); dic["1"] = "jedan"; dic["2"] = "dva"; lookupEdit.Properties.ValueMember = "Key"; lookupEdit.Properties.DisplayMember = "Value"; lookupEdit.Properties.DataSource = dic.ToList(); // if you want to hide Key column LookUpColumnInfo keyColumnInfo = new LookUpColumnInfo("Key"); keyColumnInfo.Visible = false; lookupEdit.Properties.Columns.Add(keyColumnInfo); lookupEdit.Properties.Columns.Add(new LookUpColumnInfo("Value")); // set selected item lookupEdit.EditValue = "2"; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload