title: WinForms data binding
body: <p>Concerning data binding I have these classes:</p>
  <pre><code>public class Foo : List&lt;Bar&gt;
  {
      public string FooName { get; set; }
  }
  
  public class Bar
  {
      public string BarName { get; set; }
      public string BarDesc { get; set; }
  }
  </code></pre>
  <p>And I have a <code>List&lt;Foo&gt;</code></p>
  <p>I would like to have <code>Foo</code> items in <code>ComboBox</code>, and <code>Bar</code> items in <code>ListBox</code>. When I change selected item in <code>ComboBox</code>, I want <code>ListBox</code> to change. When I change selected item in <code>ListBox</code> I would like to have <code>TextBox</code> filled with <code>BarDesc</code>.</p>
  <p>Following works only for <code>ListBox</code> and <code>ComboBox</code>:</p>
  <pre><code>comboBox1.DataSource = foos;
  comboBox1.DisplayMember = &quot;FooName&quot;;
  listBox1.DataBindings.Add(&quot;DataSource&quot;, foos, &quot;&quot;);
  listBox1.DisplayMember = &quot;BarName&quot;;
  </code></pre>
  <p>I don't now how to bind selected <code>Bar</code> in <code>ListBox</code> to <code>TextBox.Text</code> property. Maybe added binding for <code>listBox1</code> is not a good idea.</p>
  <p>Maybe I should do something like that:</p>
  <pre><code>((CurrencyManager)listBox1.BindingContext[foos]).CurrentChanged += new EventHandler((o, a) =&gt;
  {
      textBox1.DataBindings.Clear();
      textBox1.DataBindings.Add(&quot;Text&quot;, listBox1.DataSource, &quot;BarDesc&quot;);
  });
  </code></pre>
  <p>How can I resolve my problem?</p>