Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

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

share|improve this answer

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.

share|improve this answer
    
problem solved used xsl:key :) –  Patrick Nov 3 '10 at 23:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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