title: Setting the focus on a particular element from a list
body: <p>I have a form which is used both - for editing and creating a new element. I have a <code>Combobox</code> with a <code>DropDownList</code> which is filled with a data from another table and no matter if the user is in for creating a new element I want be able to show him all the elements in the <code>DropDownList</code> but when he is for editing I want to set the focus to the same element as it was in the view page.</p>
  
  <p>I these are the code parts that I use for this:</p>
  
  <p>check if the user want to create a new element:</p>
  
  <pre><code> if (!LoadEntityId.HasValue)
              {
                  entity = new Material();
  </code></pre>
  
  <p>Load the entity if the user is editing such:</p>
  
  <pre><code>entity = materialService.Find(LoadEntityId.Value);
  </code></pre>
  
  <p>Load just the value of the loaded entity (the part I want to customize as explained) :</p>
  
  <pre><code>cboTypeOfMaterial.Text = entity.MaterialTypeName;
  </code></pre>
  
  <p>where <code>cboTypeOfMaterial</code> is the <code>ComboBox</code> name in the edit form.</p>