title: c# how to speed up a combo box
body: <p>How to speed up a combo box populating speed? Academically speaking, imagine that a combox box has 1 billion records to be presented. How would we maximize the speed of the program.
  What other methods could I use instead of a combo box to display data?</p>
  
  <p>Here are the details for my particular question:<br>
  I am using WPF event handler </p>
  
  <pre><code>&lt;ComboBox Height="24" SelectedIndex="0" HorizontalAlignment="Left" 
   Margin="146,27,0,0" Name="emoployeeUserNameComboBox" VerticalAlignment="Top"
   Width="198" Loaded="emoployeeUserNameComboBox_Loaded"/&gt;
  
  private void emoployeeUserNameComboBox_Loaded(object sender, RoutedEventArgs e) {
      using (ToolboxDataContext dbToolbox = new ToolboxDataContext()) {
          var query = (from x in dbToolbox.DropDownEmployeesUserNames()
                       select x.UserName).ToList();
          this.emoployeeUserNameComboBox.ItemsSource = query;
      }
  </code></pre>
  
  <p>The stored procedure above <code>DropDownEmployeesUserNames</code> is defined as</p>
  
  <pre><code>SELECT [UserName],Emp_Number
  FROM AdminUser
  ORDER BY UserName
  </code></pre>
  
  <p>It returns 14,257 rows</p>