title: How to make autocomplete in wpf textbox?
body: <p>Here is the code I am using for search, it returns a value when we type a whole name, but I need a  autocomplete textbox, that shows suggestions as I type a partial name.</p>
  
  <pre><code>private void textBox3_KeyUp_1(object sender, System.Windows.Input.KeyEventArgs e)//Name Search
  {
      SqlConnection con = new SqlConnection(constr);
      con.Open();
      SqlCommand cmd = con.CreateCommand();
      cmd.CommandType = CommandType.Text;
      cmd.CommandText = "Select [Patient ID],[Patient Name],[Gender],[StudyDateTim],[Modality],[Study Name] From RepView Where [Patient Name] like '%" + textBox3.Text + "%'";
      cmd.ExecuteNonQuery();
      DataTable dt = new DataTable();
      SqlDataAdapter da = new SqlDataAdapter(cmd);
      da.Fill(dt);
      dataGrid1.ItemsSource = dt.DefaultView;
      con.Close();
  }
  </code></pre>