title: LookupEdit in XtraGrid cell value goes blank
body: <p>This is what I have:</p>
  
  <pre><code>public class ViewModel
  {
      public BindingList&lt;Row&gt; Rows { get; set; }
      public BindingList&lt;MyElement&gt; Selectables { get; set; }
  }
  
  public class Row
  {
      public MyElement Selected { get; set; }
  }
  
  public class MyElement
  {
      public string Value { get; set; }
      public string Friendly { get; set; }
  }
  </code></pre>
  
  <p>This is what I want:
  An <em><code>XtraGrid</code></em> with a column that has a combobox editor in each cell. The values of the dropdown options are different for different rows. Specifically the available options are subsets of <em><code>ViewModel.Selectables</code></em>, the subset is defined by businessrules at runtime.</p>
  
  <p>This is how I try to make this happen:</p>
  
  <p>I create three <em><code>BindingSources</code></em></p>
  
  <ol>
  <li><p><em><code>viewModelBindingSource</code></em>: with <em><code>DataSource = ViewModel</code></em></p></li>
  <li><p><em><code>rowsBindingSource</code></em>: with <em><code>DataSource = viewModelBindingSource</code></em> AND <em><code>DataMember = Rows</code></em></p></li>
  <li><p><em><code>selectablesBindingSource</code></em> with <em><code>DataSource = viewModelBindingSource</code></em> AND <em><code>DataMember = Selectables</code></em></p></li>
  </ol>
  
  <p>I set the grid's <code>DataSource</code> to <em><code>rowsBindingSource</code></em>.
  I create an In-place Editor Repository for a LookupEdit in the grid.
  I set the <code>repositoryItemLookUpEdit</code>'s <code>DataSource</code> to <em><code>selecteablesBindingSource</code></em>
  I set the <code>repositoryItemLookUpEdit</code> as the <code>ColumnEdit</code> value of the column</p>
  
  <p>I hook up to gridViews <em><code>ShownEditor</code></em> event: </p>
  
  <pre><code>this.gridView1.ShownEditor += gridView1_ShownEditor;
  </code></pre>
  
  <p>In <em><code>gridView1_ShownEditor(object sender, EventArgs e)</code></em> method I can then have a reference to the view so I can do something like this:</p>
  
  <pre><code>GridView view = sender as GridView;
  var newSelectables = new BindingList&lt;MyElement&gt;();
  // businesslogic to populate newSelectables ...
  var bs = new BindingSource(newSelectables, "");
  edit = (LookUpEdit)view.ActiveEditor;
  edit.Properties.DataSource = bs;
  </code></pre>
  
  <p>This works to the extent that I get the new options in the clicked combobox, and selecting the option sets the value to the bound object, that is <em><code>Row.Selected</code></em>.</p>
  
  <p>And now to my problem, when cell looses focus, <strong>the cell content turns blank</strong>.</p>
  
  <p>This seems to be caused somehow by the fact that I create a new <code>BindingSource</code> with new, because if I ommit this change of <code>DataSource</code> then the values in <em><code>ViewModel.Selectables</code></em> are used instead, and it works as expected.</p>
  
  <p>So, does anyone know why the text displayed in the cell goes blank after it looses focus in this case??</p>