How to Create ASP.NET Drop Down Control to Filter Data

So…(assuming you are using the dropdown to filter a view of some list based on the Title field)

  1. Within your site, create a new page using any standard page layout
  2. Open your site in SharePoint Designer
  3. Detach the page you created in step 1 from the page layout by right clicking on the page and selecting Detach from Page Layout
  4. Within the Task Panes, select Data Source Library
  5. Click the list you want to use as the source of the dropdown and select Insert Data Source Control
  6. With the Task Panes menu select Toolbox and insert a standard asp.net dropdownlist control
  7. Click the OOUI and select Choose Data Source
  8. Select the SPListDataSourceControl and click OK
  9. Check the box to enable autopostback
  10. Insert the list you want to filter the data on and set the following filter:

Title == [Create new Parameter]
Param name: Param1
Source: Control
ControlID: dropdownlist1
Default: foo

Save the page. When you change the dropdownlist value, it should show the selected value.

3 Responses to “How to Create ASP.NET Drop Down Control to Filter Data”

  1. mark.marquis March 30, 2009 at 12:03 pm #

    Hello First of all thanks for posting this. I have created a blank aspx page within a SharePoint test site, have not yet applied a master page and have performed the steps above using a data view as the list. I try to filter on Title however does not appear to work. Any ideas waht I could be doing wrong?

  2. shereen March 31, 2009 at 10:26 am #

    Hi Mark, have you enabled autopostback on the drop down list? if you sent me a copy of your page, i could have a look for you. or post a bit of code so i can see where you’re at.

  3. mc1 May 20, 2009 at 9:14 am #

    Thanks mark. Iit took a lot of search to find this simle and helpful post. I am new to sharepoint.
    Now I have done this. I have a next question. I want to populate the field with the users from sharepoint.the list that gets popoualted in people picker. How do i make this drop down populated with that.
    Thx

Leave a Reply