# Events

The Telerik UI PivotGrid for ASP.NET MVC [exposes multiple events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/pivotgrideventbuilder) that allow you to control the behavior of the UI component.

The following example demonstrates how you can subscribe to the `ExpandMember` and `CollapseMember` events of the component.

```Razor HtmlHelper
    @(Html.Kendo().PivotGrid()
        .Name("pivotgrid")
        .Events(e =>
        {
            e.ExpandMember("onExpandMember");
            e.CollapseMember("onCollapseMember");
        })
        ... // Other configuration.
    )

    <script>
        function onExpandMember(e) {
            console.log(e); // Review the event data.
            // Custom logic when a specified column or row field is expanded.
        }

        function onCollapseMember() {
            console.log(e); // Review the event data.
            // Custom logic before a specified column or row field is collapsed.
        }
    </script>
```

## Next Steps

* [Displaying KPI measurements by using the PivotGrid for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/pivotgrid/kpi)

## See Also

* [Client-Side API of the PivotGrid](https://docs.telerik.com/kendo-ui/api/ui/pivotgrid)
* [Server-Side API of the PivotGrid HtmlHelper](https://www.telerik.com/aspnet-mvc/documentation/api/pivotgrid)
