<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SpreadsheetViewer.aspx.cs" Inherits="SpreadsheetViewer" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style>
        .rssToolbarWrapper,
        .rssFormulaBar {
            display: none;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" />

        <telerik:radspreadsheet runat="server" id="RadSpreadsheet1" width="100%" height="700px" />
        <asp:HiddenField runat="server" ID="HiddenField1" />
        <script type="text/javascript">
            // Script to initialize the RadSpreadsheet from the hidden field value
            document.addEventListener('DOMContentLoaded', function () {
                var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
                var workbookJson = <%= HiddenField1.Value %>;

                if (spreadsheet && workbookJson) {
                    spreadsheet.get_kendoWidget().fromJSON(workbookJson);
                }
            });
        </script>
    </form>
</body>
</html>
