title: Avoid Refreshing on Databound Dropdownlist
body: <p>I am working on a metrics screen that will display several charts based on different groups in a database. Part of it uses a function that hides selected charts until the user clicks to display them. </p>
  
  <p>The problem is this: I'm using a Databind on the dropdownlist, so every time I select a new group, the page refreshes and everything returns to its default state. </p>
  
  <p>My question is this: Is there a way that I can avoid refreshing the page every time I select a new option from the dropdown list? If so, how? If not, is there a better way to create the dropdownlist and attach values to it? If I set <code>AppendDataBoundItems</code> to <code>false</code>, then I always get the selected value as the first item in the list.</p>
  
  <p>Here's my code for the dropdownlist:</p>
  
  <pre><code>    &lt;asp:DropDownList ID="MinistryDropdown" OnSelectedIndexChanged="Selection_Change" AutoPostback="true" AppendDataBoundItems="true" runat="server"/&gt;
  </code></pre>
  
  <p>Then C# code behind it is this:</p>
  
  <pre><code>public void Page_Load(object sender, EventArgs e){
      MinistryDropdown.DataSource = CreateDataSource();
      MinistryDropdown.DataTextField = "Description";
      MinistryDropdown.DataValueField = "Description";
      MinistryDropdown.DataBind();
  
  ...other code here...
  }
  ICollection CreateDataSource(){
      DataTable Ministries = new DataTable();
  
      Ministries = oDatabase.GetData(@"SELECT DISTINCT B.Description
          FROM tblInvolvement AS A LEFT JOIN tblMinistries AS B
          ON A.Activity = B.MinistryID");
  
      DataView dv = new DataView(Ministries);
      return dv;
  }
  </code></pre>