<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: combobox code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 17 May 2008 23:01:48 GMT</pubDate>
    <description>DZone Snippets: combobox code</description>
    <item>
      <title>Fill combobox with objects (other than strings)</title>
      <link>http://snippets.dzone.com/posts/show/3879</link>
      <description>&lt;code&gt;&lt;br /&gt;        public static void FillComboBoxWithOids(ComboBox comboBox)&lt;br /&gt;        {&lt;br /&gt;            comboBox.Items.Clear();&lt;br /&gt;&lt;br /&gt;            List&lt;string&gt; oids = GetColumnValues(OidColumns.COL_OID);&lt;br /&gt;            List&lt;string&gt; infos = GetColumnValues(OidColumns.COL_INFO);&lt;br /&gt;&lt;br /&gt;            comboBox.Items.Add(new ComboBoxOidItem("", "-"));&lt;br /&gt;            if ((oids != null) &amp;&amp; (infos != null))&lt;br /&gt;                for (int i = 0; i &lt; oids.Count; i++)&lt;br /&gt;                    comboBox.Items.Add(new ComboBoxOidItem(oids[i], infos[i]));&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        public class ComboBoxOidItem&lt;br /&gt;        {&lt;br /&gt;            public ComboBoxOidItem(string OID, string name)&lt;br /&gt;            {&lt;br /&gt;                _oid = OID;&lt;br /&gt;                _name = name;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            string _oid = null;&lt;br /&gt;            string _name = null;&lt;br /&gt;&lt;br /&gt;            public override string ToString()&lt;br /&gt;            {&lt;br /&gt;                return _name;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            public string Name&lt;br /&gt;            {&lt;br /&gt;                get&lt;br /&gt;                {&lt;br /&gt;                    return _name;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            public string Oid&lt;br /&gt;            {&lt;br /&gt;                get&lt;br /&gt;                {&lt;br /&gt;                    return _oid;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 24 Apr 2007 22:28:21 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3879</guid>
      <author>mstampar (Miroslav Stampar)</author>
    </item>
  </channel>
</rss>
