title: How to populate ASPxComboBox?
body: <p>I have Editable ASPxGridView and confused how to populate the ASPxComboBox init.</p>
  
  <p>Consider The following scenario in which we have a list of cars with colors.</p>
  
  <p><img src="https://i.stack.imgur.com/FcwK1.jpg" alt="Initial GridView"></p>
  
  <p>After Edit is clicked.</p>
  
  <p><img src="https://i.stack.imgur.com/2uX5w.jpg" alt="GridView after Edit Button is pressed"></p>
  
  <p>I want to add datasource to this highlighted color combobox. My code is given below:</p>
  
  <p>ASP Code</p>
  
  <pre><code>&lt;dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" 
  KeyFieldName="ID" onstartrowediting="ASPxGridView1_StartRowEditing"&gt;
  &lt;Columns&gt;
      &lt;dx:GridViewCommandColumn VisibleIndex="0"&gt;
          &lt;EditButton Visible="True"&gt;
          &lt;/EditButton&gt;
      &lt;/dx:GridViewCommandColumn&gt;
      &lt;dx:GridViewDataTextColumn Caption="ID" FieldName="ID" Name="ID" 
          VisibleIndex="1"&gt;
      &lt;/dx:GridViewDataTextColumn&gt;
      &lt;dx:GridViewDataTextColumn Caption="Car" FieldName="Car" Name="Car" 
          VisibleIndex="2"&gt;
          &lt;EditItemTemplate&gt;
                 &lt;dx:ASPxComboBox ID="ASPxComboBox1" runat="server" 
                             Text='&lt;%# Eval("Car") %&gt;'&gt;
                 &lt;/dx:ASPxComboBox&gt;
          &lt;/EditItemTemplate&gt;
      &lt;/dx:GridViewDataTextColumn&gt;
      &lt;dx:GridViewDataTextColumn Caption="Color" FieldName="Color" Name="Color" 
          VisibleIndex="3"&gt;
          &lt;EditItemTemplate&gt;
              &lt;dx:ASPxComboBox ID="colorCombo" runat="server"&gt;
              &lt;/dx:ASPxComboBox&gt;
          &lt;/EditItemTemplate&gt;
      &lt;/dx:GridViewDataTextColumn&gt;
  &lt;/Columns&gt;
  </code></pre>
  
  <p>
                      </p>
  
  <p>C# Code</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              DataTable dt = new DataTable();
              dt.Columns.Add("ID");
              dt.Columns.Add("Car");
              dt.Columns.Add("Color");
  
              DataRow dr = dt.NewRow();
              dr["ID"] = "1";
              dr["Car"] = "Suzuki";
              dr["Color"] = "Green";
              dt.Rows.Add(dr);
  
              dr = dt.NewRow();
              dr["ID"] = "2";
              dr["Car"] = "Toyota";
              dr["Color"] = "Blue";
              dt.Rows.Add(dr);
  
              dr = dt.NewRow();
              dr["ID"] = "3";
              dr["Car"] = "Toyota";
              dr["Color"] = "Black";
              dt.Rows.Add(dr);
  
              grid.DataSource = dt;
              grid.DataBind();
          }
  
          protected void ASPxGridView1_StartRowEditing(object sender,
                            DevExpress.Web.Data.ASPxStartRowEditingEventArgs e)
          {
              DataTable dt = new DataTable();
              dt.Columns.Add("ID");
              dt.Columns.Add("Color");
  
              DataRow dr = dt.NewRow();
              dr["ID"] = "1";
              dr["Color"] = "Green";
              dt.Rows.Add(dr);
  
              dr = dt.NewRow();
              dr["ID"] = "2";
              dr["Color"] = "Blue";
              dt.Rows.Add(dr);
  
              dr = dt.NewRow();
              dr["ID"] = "3";
              dr["Color"] = "Black";
              dt.Rows.Add(dr);
  
              dr = dt.NewRow();
              dr["ID"] = "4";
              dr["Color"] = "Red";
              dt.Rows.Add(dr);
  
              dr = dt.NewRow();
              dr["ID"] = "5";
              dr["Color"] = "Yellow";
              dt.Rows.Add(dr);
  
  
              ASPxComboBox cb=(ASPxComboBox)grid.FindEditRowCellTemplateControl(
                                   grid.Columns["Color"] as GridViewDataColumn  
                                  , "colorCombo");
              cb.DataSource = dt;
              cb.DataBind();
  
          }
  </code></pre>
  
  <p>After putting break point on cb.Datasource = dt; it is verified that values are populated but not viewed on the page. This populating of combobox cannot be done on page_load(). If anyone know the solution kindly tell me in easy and simple words.</p>
  
  <p>NOTE: <code>Datasource</code> is coming from <code>database</code>, here I just hardcoded it in <code>Pageload()</code>.</p>