sharepoint-2007spgridview

Disable ECB menu in SPGridview


I need to disable OOtb Filtering and Sorting menu in SPGridview and apply custom filtering and sorting. So far i have done custom part and it comnfuses with ootb filtering when user tried to use both. so suggest me a way to disable ootb filtering and sorting in spgridview


Solution

  • Disabling ECB menu in SPgridview is bit tricky and using jquery would be ideal to do that.

        <script type="text/javascript"> 
          $(document).ready(function() {
            $('.ms-unselectedtitle').removeAttr("onclick");
            $('.ms-unselectedtitle').removeAttr("onmouseover");
            $('.ms-menuimagecell').remove();
          }); 
        </script>
    

    simply it will remove the onclick and onmousover attribute as well as remove the arrow image from spgridview header..