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>

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


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>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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