We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to hide the check boxes and context menu under Field List in PivotSchemaDesigner?

Platform: ASP.NET Web Forms |
Control: PivotGrid |
Published Date: March 8, 2016 |
Last Revised Date: July 2, 2019

This KB illustrates that how to hide the check boxes and context menu in Field List.

Solution

In-general, PivotSchemaDesigner has many UI options to add/remove/move fields in desired field area. The options are,

  1. Drag and drop from Field List to field area
  2. Check boxes
  3. Context menu

Below screen-shot shows the check boxes and context menu in PivotSchemaDesigner.

C:\Users\RameshG\Desktop\1.png

 

You can hide the check boxes and context menu under Field List of PivotSchemaDesigner by using below steps.

To hide check boxes, we can utilize their class name “.schemaFieldList .e-chkbox-small” and apply the CSS style “display: none”, which hides the entire check boxes under Field List.

To hide context menu, the required code is written inside the “OnAfterServiceInvoke” event of PivotSchemaDesigner. Like check boxes, we can utilize the class name of the context menu to remove it using jQuery. The code is like $(".pivotTreeContext").remove() under the function “hideContextMenu()” as mentioned in the below code sample.

NOTE: The class “.pivotTreeContext” of the context menu will be generated only after PivotGrid control is rendered. Calling the function “hideContextMenu()” before that could not be effective. So we have to set delay, in-order to activate the function “hideContextMenu()” using “setTimeout” function.

 

The code sample below illustrates on how to hide the check boxes in Field List.

CSS

<style>
    .schemaFieldList .e-chkbox-small {                     
        display: none;    }
</style>

 

 

The code sample below illustrates on how to hide the context menu in Field List.

Script

 
@Html.EJ().Pivot().PivotGrid("PivotGrid1").Url(Url.Content("~/wcf/RelationalService.svc")).ClientSideEvents(events => events.AfterServiceInvoke("OnAfterServiceInvoke"))
 
@Html.EJ().Pivot().PivotSchemaDesigner("PivotSchemaDesigner")
 
 
<script type="text/javascript">
    OnAfterServiceInvoke = function (evt) {
        if (evt.action == "initialize") {
            var PivotSchemaDesigner = $("#PivotSchemaDesigner").data('ejPivotSchemaDesigner');
            if (PivotSchemaDesigner.model.pivotControl == null) {
                PivotSchemaDesigner.model.enableWrapper = true;
                PivotSchemaDesigner.model.pivotControl = this;
                PivotSchemaDesigner.model.layout = "excel";
                PivotSchemaDesigner._load();
                setTimeout(hideContextMenu, 500);
            }
        }
    }
    function hideContextMenu() {
        $(".pivotTreeContext").remove();
    }</script>
 

 

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon