title: DropDownList Clear Selection in C# ASP.Net
body: <p>I have listed employee names in one Dropdownlist. And by selecting any employee i am displaying employee details in gridview from database.</p>
  
  <p>By default, dropdownlist have first item as selected item.So when i select another items it returns the first index only.
  My Code:</p>
  
  <pre><code>protected void FilterBtn_Click(object sender, EventArgs e)
  {
    if (EmployeeList.SelectedIndex &gt; -1)
    {
        sInitQuery = sInitQuery + " WHERE (EmployeeName ='" + EmployeeList.SelectedItem.ToString() + "')";
    }
    if (GlobalCS.OpenConnection() == true)
    {
              GridView1.DataSource = null;
              GridView1.DataBind();    
  
              MySqlCommand cmd = new MySqlCommand(sInitQuery, GlobalCS.objMyCon);
              MySqlDataReader reader = cmd.ExecuteReader();
              GridView1.DataSource = reader;
              GridView1.DataBind();
              reader.Close();
    }
    GlobalCS.CloseConnection();
    EmployeeList.ClearSelection();
  }
  </code></pre>