1,761 articles and 13,668 comments as of Sunday, November 14th, 2010

Thursday, October 8, 2009

Filtering a SharePoint Data View – Part 3

Guest Author: David Severn

Following directly on from part 2 we will now hook up the two user interface controls.

Hover your mouse over the top right hand corner of the data view to display a small right facing arrow.

Filtering a SP Data View Part 3

Press this to display the Common Data View Tasks menu.

Filtering a SP Data View Part 3

Select Filter.

Click add new clause and select Category in the ‘field name’ drop down list.

Click on the * in the Value Field drop down to display.

Filtering a SP Data View Part 3

Select create new parameter and make selections from the two drop down lists as follows:

Filtering a SP Data View Part 3

Press OK.

This has associated the value selected in the drop down list with the parameter to be used to filter the value found in the category column in the todo list.

Press O.K again to close the filter editor.

Right Click on the drop down list and select Properties.

In the tag Properties task pane set Auto Post Back to True to cause the new selected value to be sent back to the server to filter the data view.

Filtering a SP Data View Part 3

Save Changes and display the page.

Select different categories to show different to do items.

Filtering a SP Data View Part 3

Filtering a SP Data View Part 3

With a bit of planning, some useful user scenarios can be created with a very small amount of effort.

And no code!

David SevernGuest Author: David Severn

David Severn is a Developer specialising in ASP.Net and SharePoint related technologies. He holds various Microsoft certifications including MCTS for WSS Development and Moss configuration. He lives with his wife and three children in the west of Ireland.

View all entries in this series: DavidSevern - Filtering a Data View»
Entries in this series:
  1. Filtering a SharePoint Data View - Part 1
  2. Filtering a SharePoint Data View - Part 2
  3. Filtering a SharePoint Data View - Part 3
 

Please Join the Discussion

5 Responses to “Filtering a SharePoint Data View – Part 3”
  1. larry says:

    Nice post, and clearly explained. Great job.

  2. Caleb says:

    Thanks so much for this series. I’ve always wondered how to filter a data view through the end user interface.

    I have a question: How do you show all items by default? I followed your steps and the default view shows the data view filtered by the first item in the category list. Is there a way to show all items from all categories by default?

  3. DavidS says:

    Thanks for the tip. The MSDN article about this functionalty botched the drop-down list.

  4. Adam B says:

    Is it possible to put a second datasource on there and have it filter the same dataview? For example, I would have a dropdown to sort by category but would also want to put a dropdown that sorts by letter (e.g. A-Z listing). Any details, assistance or pointing in the right direction would be appreciated. Great stuff!

Trackbacks

Check out what others are saying about this post...



Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!