SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to disable sorting but allow filtering on DVWP.

I have struggled much for it but not able to get rid of it. If I pass 0 in sortable then it takes away both filter and sorting from context menu.

<xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
                        <xsl:with-param name="fieldname">@Title</xsl:with-param>
                        <xsl:with-param name="fieldtitle">Title</xsl:with-param>
                        <xsl:with-param name="displayname">Title</xsl:with-param>
                        <xsl:with-param name="sortable">1</xsl:with-param>
                        <xsl:with-param name="fieldtype">x:string</xsl:with-param>
                    </xsl:call-template>

Please suggest how can i achieve this? Thanks!!!

share|improve this question

Find the

<xsl:template name="dvt.headerfield">

Add a parameter

<xsl:param name="filterable">1</xsl:param>

Find the <table and remove the onmouseover attribute

under the <table tag, add

<xsl:if test="$filterable=1">
    <xsl:attribute name="onmouseover">OnMouseOverAdHocFilter(this, '{concat($displayname,$separator,$fieldname, $separator,$fieldtype, $connector, 1033, $separator, $dvt_partguid)}')</xsl:attribute>
</xsl:if>
share|improve this answer

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.