New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Events

The Telerik UI Spreadsheet for ASP.NET MVC exposes a number of JavaScript events that allow you to control the behavior of the UI component.

For a complete example of how to handle all Spreadsheet events triggered by user interaction, refer to the demo on using the events of the Spreadsheet .

Subscribing to Events

The following example demonstrates how to subscribe to the Changing and Change events.

    @(Html.Kendo().Spreadsheet()
        .Name("spreadsheet")
        .Events(events => events
            .Changing("onChanging")
            .Change("onChange")
        )
        .Sheets(sheets =>
        {
            sheets.Add()
                .Name("Sheet1")
                .Columns(columns =>
                {
                    columns.Add().Width(115);
                })
                .Rows(rows =>
                {
                    rows.Add().Height(25).Cells(cells =>
                    {
                        cells.Add()
                            .Value("ID")
                            .TextAlign(SpreadsheetTextAlign.Center);
                    });
                });
        })
    )

    <script>
        function onChanging(e) {
            // Handle the changing event.
        }

        function onChange(e) {
            // Handle the change event.
        }
    </script>

Next Steps

See Also

In this article