I'm building a tab based on a list in the list i have something like this: Title Categories Bread Food Mazda Car VW Car Egg Food

How can i get a unique value in the category field? I tried using marcs method from: http://sympmarc.com/2007/10/23/eliminating-duplicates-in-data-view-web-parts/ But its not working with SP 2010 sharepoint designer... Any ideas and thanks in advance

2 Answers 2


If you need to do this in pure XSL you can use xsl:key to pick out the unique values in your XML data. The key element is often used with the Muenchian method to render the groupings

If you are coding in C# then I'm not aware of any CAML support for Distinct queries. So you'll need to retrieve the full data set and "distinct" it yourself. .Net has some support for this in DataTable.ToTable


SharePoint 2010 gives you the ability to create unique list columns OOB. So you can edit the properties of the Categories field and mark it to contain unique values.

  • problem solved used xsl:key :)
    – Patrick
    Commented Nov 3, 2010 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.