Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Solution:</strong> Just add two columns to <code>lookupEdit</code> and then assign <code>datasource</code>. after that you will be able to access these columns. Dynamically generated columns does not added to <code>lookupEdit.properties.Columns</code> collection.</p> <p>Refer <a href="http://documentation.devexpress.com/#windowsforms/clsDevExpressXtraEditorsLookUpEdittopic" rel="nofollow noreferrer">LookUpEdit Class</a></p> <p>Use this:</p> <pre><code>private void CreateLookupEdit() { ledMyControl = new LookUpEdit(); ledMyControl.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Key")); ledMyControl.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Value")); this.Controls.Add(ledMyControl); Dictionary&lt;string, string&gt; dic = new Dictionary&lt;string, string&gt;(); dic.Add("Test", "1"); dic.Add("Test2", "2"); dic.Add("Test3", "3"); dic.Add("Test4", "4"); dic.Add("Test5", "5"); dic.Add("Test6", "6"); dic.Add("Test7", "7"); dic.Add("Test8", "8"); dic.Add("Test9", "9"); dic.Add("Test10", "10"); ledMyControl.Properties.DisplayMember = "Value"; ledMyControl.Properties.ValueMember = "Key"; ledMyControl.Properties.DataSource = dic.ToList(); ledMyControl.Properties.Columns[0].Visible = false; } </code></pre> <p>References:<br> <a href="http://www.devexpress.com/Support/Center/p/Q131292.aspx" rel="nofollow noreferrer">Dictionary as datasource</a><br> <a href="http://www.devexpress.com/Support/Center/p/Q246473.aspx" rel="nofollow noreferrer">LookupEdit bound to ArrayList</a><br> <a href="http://www.devexpress.com/Support/Center/p/Q441481.aspx" rel="nofollow noreferrer">Feed lookupEdit with Dictionary</a> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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