Data View sort

T

Tom Brophy

I have some web pages that have data views and I need to give the user the
option to sort by different columns (such as a hyperlink they click on). I'm
not too familiar with HTML code. How can I get this done? Any code examples
would be fantastic.

Below is the query as it is right now. I see the 'OrderBy' and 'OrderField
Name=" near the bottom and I know this is how it is sorting and I changed
what's in the quotes to a different field name and it sorted the way I would
have expected. Now, how can I give the user an option to sort? Another
quick question: If I wanted a second sort field within the first would I just
add another 'OrderField Name=" below the first?

Thanks for any help you can give me.

Tom Brophy


<dsp:Query>
<dsp:Fields>
<dsp:Field Name="City"/>
<dsp:Field Name="SalesPerson"/>
<dsp:Field Name="Contact"/>
<dsp:Field Name="Company"/>
<dsp:Field Name="Building"/>
<dsp:Field Name="Phone"/>
<dsp:Field Name="SqFeet"/>
<dsp:Field Name="SalePrice"/>
<dsp:Field Name="BidDate"/>
<dsp:Field Name="DueDate"/>
<dsp:Field Name="Level"/>
<dsp:Field Name="ID"/>
<dsp:Field Name="NextAction"/>
<dsp:Field Name="FollowupDate"/>
</dsp:Fields>
<dsp:OrderBy
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
<dsp:OrderField Name="SalesPerson"
Type="xsd:string" Direction="ASC"/>
</dsp:OrderBy>
</dsp:Query>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top