<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: WinForms ComboBox with values like the WebForms DropDownList</title>
	<atom:link href="http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/</link>
	<description>01100010 01101100 01100101 01101000</description>
	<lastBuildDate>Tue, 07 Feb 2012 21:10:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: NahuelGQ</title>
		<link>http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/comment-page-1/#comment-111871</link>
		<dc:creator>NahuelGQ</dc:creator>
		<pubDate>Sun, 09 Mar 2008 14:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/#comment-111871</guid>
		<description>Hi guys:
Another way to get the same behaviour is to overriding the &quot;ToString&quot; method.

Like this:

public class ComboBoxItem
{
  private string _value;
  private string _text;

  public string Value { get { return _value; } }
  public string Text  { get { return _text ; } }

  public ComboBoxItem (string cValue, cText)
  {
    this._value = cValue;
    this._text  = cText;
  }

  public override string ToString()
        {
            return this.Text;
        }
}

NahuelGQ</description>
		<content:encoded><![CDATA[<p>Hi guys:<br />
Another way to get the same behaviour is to overriding the &#8220;ToString&#8221; method.</p>
<p>Like this:</p>
<p>public class ComboBoxItem<br />
{<br />
  private string _value;<br />
  private string _text;</p>
<p>  public string Value { get { return _value; } }<br />
  public string Text  { get { return _text ; } }</p>
<p>  public ComboBoxItem (string cValue, cText)<br />
  {<br />
    this._value = cValue;<br />
    this._text  = cText;<br />
  }</p>
<p>  public override string ToString()<br />
        {<br />
            return this.Text;<br />
        }<br />
}</p>
<p>NahuelGQ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sotto</title>
		<link>http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/comment-page-1/#comment-100082</link>
		<dc:creator>sotto</dc:creator>
		<pubDate>Sat, 19 Jan 2008 11:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/#comment-100082</guid>
		<description>new KeyValuePair&lt;int, string&gt;(0, “zero”) that is !</description>
		<content:encoded><![CDATA[<p>new KeyValuePair&lt;int, string&gt;(0, “zero”) that is !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sotto</title>
		<link>http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/comment-page-1/#comment-100081</link>
		<dc:creator>sotto</dc:creator>
		<pubDate>Sat, 19 Jan 2008 10:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejackol.com/2008/01/17/winforms-combobox-with-values-like-the-webforms-dropdownlist/#comment-100081</guid>
		<description>If you&#039;re using .NET 2.0 you can try this:

comboBox1.ValueMember = &quot;Key&quot;;
comboBox1.DisplayMember = &quot;Value&quot;;
            
comboBox1.Items.Add(new KeyValuePair(0, &quot;zero&quot;));
comboBox1.Items.Add(new KeyValuePair(1, &quot;one&quot;));

if using .NET 1.x i think there&#039;s another class you could use (without the generics)... but can&#039;t remember exactly.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using .<span class="caps">NET</span> 2.0 you can try this:</p>
<p>comboBox1.ValueMember = &#8220;Key&#8221;;<br />
comboBox1.DisplayMember = &#8220;Value&#8221;;</p>
<p>comboBox1.Items.Add(new KeyValuePair(0, &#8220;zero&#8221;));<br />
comboBox1.Items.Add(new KeyValuePair(1, &#8220;one&#8221;));</p>
<p>if using .<span class="caps">NET</span> 1.x i think there&#8217;s another class you could use (without the generics)&#8230; but can&#8217;t remember exactly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

