DVWP How to remove duplicate entries in filter dropdown list
By peter.stilgoe
When displaying the filter bar in a data view webpart it will list multiple instances of the same option if the data exists multiple times in your datasource ie. say you have a 100 list items & one of the columns contains a ‘yes’ or ‘no’, it will list them 100 times instead of just a single ‘yes’ / ‘no’ option to apply on your filter.
To remove duplicate filter options, open your dataview webpart in Sharepoint Designer & look for:
Simply remove the ‘[1]‘ from each filter option, now your filter dropdowns will only display unique values, removing the duplicate options.
data , dvwp , Sharepoint Designer About... peter.stilgoe
Sharepoint, InfoPath, K2, Nintex, Business Process Mapping, Business Intelligence, Automation, ECM, Document Management, Document Imaging, Internet Marketing & Online Business Consultant Email / MSN: pstilgoe@hotmail.com LinkedIn: Pete Stilgoe - Sharepoint Consultant
Share
9 Comments
Tag Cloud
C#
calculated column
Content Editor Webpart
content types
cqwp
dates
dvwp
InfoPath
infopath tips & tricks
Information Architechture
Javascript
JQuery
K2 Blackpearl
K2 Blackpoint
K2 Blackpoint Troubleshooting
K2 Troubleshooting
MS Office
NHS Sharepoint
one way trust
Open XML SDK 2
Powershell
search
search results
Sharepoint / MOSS / WSS
Sharepoint 2010
Sharepoint Access Services
Sharepoint CSS
Sharepoint Customisation
Sharepoint Errors
Sharepoint How To
Sharepoint Lists
Sharepoint Master Pages
Sharepoint Pages
Sharepoint Service Applications
Sharepoint Webparts
sql 2008
SQL Server
stsadm
Taxonomy
user profiles
Visual Studio 2010
Word Automation Services
xml
xsl
xslt
Recent Posts
Recent Comments
- Mikhail on SharePoint Analyzer: Diagnostic Tool for Best Practices
- Stephen Owen on Sharepoint: Removing illegal characters from filenames prior to bulk uploading
- Jeanne on Sharepoint 2010: How to remove columns from content types using powershell
- Vijay on Sharepoint Object Model C# Error The Web Application at could not be found. Verify that you have typed the URL correctly
- Dinesh on Document Sets in Sharepoint 2010 – Limitations
Categories
- Access
- ACT
- ADFS
- ADO.net
- Affiliate Marketing
- Analytics & Tracking
- Autodesk Inventor / Vault
- AvePoint
- BDC
- Betting
- Blackberry / BES
- Business & Entrepreneurship
- Business Intelligence
- Business Physcology
- C#
- CAML
- CNC
- Codeplex
- Content Editor Webpart
- Content Query Webpart
- Document Imaging
- Document Management
- Domain Name Investing
- Email Marketing
- Enterprise Content Management
- Enterprise Search
- Extranet
- Firewalls
- Forefront Security
- Forex
- Forms Server
- IIS
- InfoPath
- Information Architechture
- Internet Marketing
- ITIL
- Javascript
- JQuery
- K2 Blackpearl
- K2 Blackpoint
- Kerberos
- KnowledgeLake
- Making Money
- Microsoft Dynamics CRM
- Micross / Omnis
- Misc
- MS Exchange
- MS Office
- MS UAG
- NHS Sharepoint
- Nintex
- Novell Netware
- Open XML SDK
- Oracle
- Pay Per Click
- PerformancePoint
- Perofrmance Tuning
- Ports
- Powerpivot
- Powershell
- Project Management
- RAM / Memory
- Records Management
- Relex Studio
- Sharepoint / MOSS / WSS
- Sharepoint 2010
- Sharepoint Access Services
- Sharepoint Alerts
- Sharepoint Backup Restore
- Sharepoint Business Connectivity Services
- Sharepoint Calculated Columns
- Sharepoint Commercial Websites
- Sharepoint Content Type Hub
- Sharepoint Content Types
- Sharepoint CQWP
- Sharepoint CSS
- Sharepoint Customisation
- Sharepoint Databases
- Sharepoint Designer
- Sharepoint Document Sets
- Sharepoint DVWP
- Sharepoint Errors
- Sharepoint Excel Web Services
- Sharepoint Forms
- Sharepoint How To
- Sharepoint IA
- Sharepoint Layouts
- Sharepoint Lists
- Sharepoint Lookup Columns
- Sharepoint Master Pages
- Sharepoint Migration
- Sharepoint Project Planning
- Sharepoint Publishing Sites
- Sharepoint Redundancy
- Sharepoint Search
- Sharepoint Security
- Sharepoint Service Applications
- Sharepoint Site Templates
- Sharepoint Solution Files
- Sharepoint SSO
- Sharepoint SSP
- Sharepoint STSADM
- Sharepoint Styling
- Sharepoint Surveys
- Sharepoint Templates
- Sharepoint Timer Jobs
- Sharepoint Updates
- Sharepoint User Profiles
- Sharepoint Views
- Sharepoint Web Applications
- Sharepoint Webparts
- Sharepoint Webservices
- Sharepoint Workflows
- SMTP
- SQL Reporting Services
- SQL Server
- SQL Server 2008
- SQL SSIS
- SSAS
- SSO
- Symantec
- Taxonomy
- Trust Relationships
- Video Conferencing
- Virtualization
- Visual Studio 2010
- Windows / Active Directory
- Windows Server 2008
- Windows Trust Relationship
- Windows User Profiles
- Windows Vista
- Word Automation Services
- Workflow
- xml
- Xpath
- xsl
- XSLT
Archive
- January 2012 (6)
- November 2011 (2)
- October 2011 (1)
- September 2011 (1)
- August 2011 (1)
- July 2011 (5)
- June 2011 (3)
- May 2011 (12)
- April 2011 (13)
- March 2011 (15)
- February 2011 (15)
- January 2011 (10)
- December 2010 (8)
- November 2010 (7)
- October 2010 (7)
- September 2010 (4)
- August 2010 (4)
- July 2010 (16)
- June 2010 (4)
- May 2010 (4)
- April 2010 (4)
- March 2010 (11)
- February 2010 (4)
- January 2010 (8)
- December 2009 (2)
- November 2009 (6)
- October 2009 (7)
- September 2009 (11)
- August 2009 (14)
- July 2009 (4)
- June 2009 (2)
- April 2009 (1)
- March 2009 (5)
- February 2009 (2)
- January 2009 (4)
- December 2008 (5)
- November 2008 (14)
- October 2008 (17)
- September 2008 (10)
- August 2008 (14)
- July 2008 (10)
- June 2008 (4)
- May 2008 (2)
- April 2008 (12)
- March 2008 (19)
- February 2008 (5)
- January 2008 (7)
- December 2007 (2)
- November 2007 (14)
- October 2007 (7)
- September 2007 (1)
- August 2007 (4)
- July 2007 (18)
- June 2007 (14)
- May 2007 (13)
- April 2007 (4)
- March 2007 (3)
- February 2007 (3)
- January 2007 (2)
- December 2006 (2)
- November 2006 (2)
- October 2006 (13)
- September 2006 (7)
- August 2006 (7)
- July 2006 (4)
- June 2006 (1)
- May 2006 (5)
- April 2006 (3)
- March 2006 (6)
- February 2006 (2)
- January 2006 (3)
Sharepoint / MOSS / WSS
- Cloud Computing Integration
- Cloud Taxonomy
- Good examples of Jquery & HTML
- Information Architechture
- MOSS MVP – Good Tips
- Pingar – Taxonomy Builder
- Search Federation – Twitter Example
- Sharepoint 2010 BI
- SharePoint 2010 Branding & Design
- Sharepoint Boris
- Sharepoint Powershell Scripts
- TaxoCloud.com
- Workflow Management Coalition



August 24th, 2010

Excellent..and very deed time i found your page…save much time….
[Reply]
Simply Excellent. ThanQ you so much for you valueble information.
[Reply]
Ok..I cannot found the code in my SPD..anyone can help?
Table
Title
Broadcast Date
Business Unit
Broadcast Channel
Type of Project
Size
Revenue
Cost
ms-alternating
[Reply]
I cannot find the code..i just find this one in my SPD
[Reply]
peter.stilgoe Reply:
April 27th, 2011 at 5:40 am
Not sure why you cant see it, try exporting the webpart & then edit it & see if you can see the code. I presume you have turned on the filter bar in SPD for your DVWP?
[Reply]
Ok.Thanks!!..I’m already found the code.
But the problem is when I selected filter, the data view webpart is returning different type of value.
For example in Business Unit column, I have Email and SMS.
In the filter dropdown list, it have Email and SMS value.But when I selected Email, It don’t return email as the filter value but return SMS.
Why?
[Reply]
Thanks!Excellent solutions.
I would like to know if I can combine filter in the DVWP.
For Example :
Here’s a sample
country city size
usa new york big
usa boston medium
usa miami medium
usa omaha small
spain madrid big
spain barcelone medium
spain majorca small
spain seville small
Now i just can filter country or city or size. if i select usa, the
data wiew will show
country city size
usa new york big
usa boston medium
usa miami medium
usa omaha small
But if i check the City o Size select fields they will show the whole
list as i’m not able to combine. I’d like to see just the us cities. Or
select Size=Big (and usa still filterede) and the data view should just
show new york. By now, if i select Size=Big, it will show Madrid and
New York
Some idea?
Thanks
[Reply]
Thank you for this. It works great for regular text fields, but it doesn’t work for user type fields, any ideas? Is there a simple elegant way to get user names to display correctly in a filter option list? Ie, no duplicates, and no rich text? And for the filter to still work?
[Reply]
this solution is not working for me. Please suggest any other
[Reply]