title: ext.net combo box not displaying an initial value
body: <p>I need to add combobox fields to a gridpanel.  I added combo boxes, but they are not showing the original selection. When I click on the dropdown, I get all the dropdown values correctly and can select a value for a field.  The problen with the initial selection.  I'm new to ext.net and I'm suspecting that something is not done in the correct order.</p>
  
  <p>Thanks,</p>
  
  <p>Jenny</p>
  
  <p>This is the codebehind EditExample.aspx.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using DataTypes;
  using Ext.Net;
  
  namespace myApp
  {
      public class info
      {
          public string Name { get; set; }
          public string Code { get; set; }
          public Description aDescription { get; set; }
  
          public int DescriptionId
          {
              get { return this.aDescription != null ? this.aDescription.id : -1; }
          }
  
          public static List&lt;info&gt; GetAll()
          {
              return new List&lt;info&gt;
              {
                  new info { Code = "1", aDescription = Description.GetAt(1), Name = "" },
                  new info { Code = "2", aDescription = Description.GetAt(2), Name = "2 Names" },
                  new info { Code = "3", aDescription = Description.GetAt(3), Name = "3 Names" },
                  new info { Code = "4", aDescription = Description.GetAt(4), Name = "4 Names" },
                  new info { Code = "5", aDescription = Description.GetAt(5), Name = "5 Names" },
                  new info { Code = "6", aDescription = Description.GetAt(6), Name = "6 Names" } 
              };
          }
      }
  
      public class Description
      {
          public int id {get; set; }
          public string description { get; set; }
  
          public static Description GetAt( int Index )
          {
              return new Description { description = "Description: " + Index, id = Index };
          }
  
          public static List&lt;Description&gt; GetAll(int max)
          {
              List&lt;Description&gt; all = new List&lt;Description&gt;();
              for ( int i = 1; i &lt;= max; i++ )
              {
                  Description thisDesc = new Description { description = "Description: " + i, id = i };
                  all.Add( thisDesc );
              };
              return all;
          }
      }
  
      public partial class EditExample : System.Web.UI.Page
      {
          public List&lt;info&gt; thisInfo = new List&lt;info&gt;();
          public List&lt;Description&gt; thisCombo = new List&lt;Description&gt;();
  
          protected void Page_Load( object sender, EventArgs e )
          {
              thisCombo = Description.GetAll(5);
              thisInfo = info.GetAll();
  
              this.extStore.DataSource = thisInfo;
  
              this.extStoreCombo.DataSource = thisCombo;
              this.extStoreCombo.DataBind(); this.extStore.DataBind();
  
         }
      }
  </code></pre>
  
  <p>This is the ExitExample.aspx</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditExample.aspx.cs" Inherits="myApp.EditExample" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
  
          var onBeforeEdit = function (e) {
              var column = e.grid.getColumnModel().columns[e.column],
            ed = column.getCellEditor(e.row);
              if (ed &amp;&amp; (e.value != '' &amp;&amp; e.value != undefined)) {
                  return false;
              }
          }
  
          var descriptionRenderer = function (id) {
              var r = extStoreCombo.getById(id);
  
              if (Ext.isEmpty(r)) {
                  return "";
              }
  
              return r.data.description;
          };
  
  
          &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
  
      &lt;ext:ResourceManager runat="server" /&gt;
      &lt;ext:Store ID="extStore" runat="server" &gt;
              &lt;Reader&gt;
                  &lt;ext:JsonReader&gt;
                      &lt;Fields&gt;
                          &lt;ext:RecordField Name = "Name" /&gt;
                          &lt;ext:RecordField Name = "Code" &gt;&lt;/ext:RecordField&gt;
                          &lt;ext:RecordField Name = "DescriptionId" &gt;&lt;/ext:RecordField&gt;
                      &lt;/Fields&gt;
                  &lt;/ext:JsonReader&gt;
              &lt;/Reader&gt;
          &lt;/ext:Store&gt;
      &lt;div&gt;
      &lt;ext:GridPanel ID="extGrd" runat="server" StripeRows="true" TrackMouseOver="true"
      StoreID="extStore" Cls="x-grid-custom" 
      Height="250px" Layout="fit"&gt;
      &lt;ColumnModel ID="cmFC" runat="server"&gt;  
          &lt;Columns&gt;
              &lt;ext:Column ColumnID="Name" DataIndex="Name" Header="Name"&gt;
              &lt;Editor&gt;
                  &lt;ext:TextField ID = "TextField2" runat = "server"/&gt;
              &lt;/Editor&gt;
              &lt;/ext:Column&gt;
              &lt;ext:Column ColumnID="Code" DataIndex="Code" Header="Code"&gt;
              &lt;/ext:Column&gt;
              &lt;ext:Column ColumnID="DescriptionId" DataIndex="DescriptionId" Header="Description" Editable ="true" &gt;
                  &lt;Renderer fn="descriptionRenderer" /&gt;
                  &lt;Editor&gt;
                      &lt;ext:ComboBox ID="cbDescription" runat="server"  Mode="Remote" LazyRender="true"
                      TriggerAction="All" DisplayField ="description" ValueField = "id" Editable="false" ForceSelection="true"&gt;
                      &lt;Store&gt;
                          &lt;ext:Store ID="extStoreCombo" runat="server"&gt;
                          &lt;Reader&gt;
                              &lt;ext:JsonReader IDProperty="id"&gt;
                              &lt;Fields&gt;
                                  &lt;ext:RecordField Name="id" /&gt;
                                  &lt;ext:RecordField Name="description" /&gt;
                              &lt;/Fields&gt;
                              &lt;/ext:JsonReader&gt;
                          &lt;/Reader&gt;
                          &lt;/ext:Store&gt;
                      &lt;/Store&gt;
                          &lt;%--&lt;Listeners&gt;
                              &lt;Select Fn="onSelect" /&gt;
                          &lt;/Listeners&gt;--%&gt;
                      &lt;/ext:ComboBox&gt;
                  &lt;/Editor&gt;
              &lt;/ext:Column&gt;
              &lt;ext:CheckColumn ColumnID="Check" DataIndex = "Check" Header = "Check" Editable = "true"&gt;
              &lt;/ext:CheckColumn&gt;
          &lt;/Columns&gt;  
      &lt;/ColumnModel&gt;
      &lt;Listeners&gt;
          &lt;BeforeEdit Fn="onBeforeEdit" /&gt;
  &lt;%--        &lt;CellClick Fn="setEditor2" /&gt; --%&gt;
          &lt;Render Handler="this.getColumnModel().setEditable(3, true);" /&gt;
      &lt;/Listeners&gt;
      &lt;SelectionModel&gt;
          &lt;ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" MoveEditorOnEnter="true"/&gt;
      &lt;/SelectionModel&gt;   
      &lt;LoadMask ShowMask="true" /&gt;
      &lt;/ext:GridPanel&gt;
      &lt;/div&gt;
      &lt;div&gt;
      &lt;ext:Button ID="btnSubmitHH" runat="server" Text="Submit Household" Icon="Accept" Disabled="true"&gt;
          &lt;DirectEvents&gt;
              &lt;Click OnEvent="SubmitHH"&gt;
                  &lt;Confirmation ConfirmRequest="true" Message="Are you sure you want to submit?" /&gt;
              &lt;/Click&gt;
          &lt;/DirectEvents&gt;
      &lt;/ext:Button&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>