diff --git a/knowledge-base/spreadsheet-hide-toolbar-formula-sheet-bar.md b/knowledge-base/spreadsheet-hide-toolbar-formula-sheet-bar.md new file mode 100644 index 0000000000..4f9622361a --- /dev/null +++ b/knowledge-base/spreadsheet-hide-toolbar-formula-sheet-bar.md @@ -0,0 +1,85 @@ +--- +title: Hide Toolbar, Formula Bar, or Sheet Bar in Spreadsheet +description: Learn how to hide the toolbar, formula bar, and sheet bar in theTelerik Spreadsheet component for Blazor. +type: how-to +page_title: How to Change the Visibility of Spreadsheet Parts in Blazor +slug: spreadsheet-kb-hide-toolbar-formula-sheet-bar +tags: spreadsheet, blazor, toolbar, formula bar, sheet bar, css, visibility +res_type: kb +ticketid: 1676073 +--- + +## Environment + + + + + + + + +
ProductSpreadsheet for Blazor
+ +## Description + +I want to display only the spreadsheet portion and hide the toolbar, formula bar, and sheet bars in the Spreadsheet component. + +## Solution + +To change the visibility of the toolbar, formula bar, and sheet bar in the Spreadsheet for Blazor, apply conditional CSS classes to hide the respective components. + +>caption This approach is applicable only if the app can trust its users not to show back the tools through the browser console. + +````RAZOR + + + + + + + + + +@code { + private byte[]? SpreadsheetData { get; set; } + private bool ShowHeader { get; set; } + private bool ShowActionBar { get; set; } + private bool ShowSheetsBar { get; set; } + + // Dynamically generate the class based on the checkbox states + private string SpreadsheetClass => $"{(ShowHeader ? "" : "hide-header")} " + + $"{(ShowActionBar ? "" : "hide-action-bar")} " + + $"{(ShowSheetsBar ? "" : "hide-sheets-bar")}"; + + protected override async Task OnInitializedAsync() + { + SpreadsheetData = Convert.FromBase64String(SampleExcelFile); + + // Or, load a file from your file system. + // Specify the full File namespace or use namespace aliases + // to avoid ambiguous reference with the Telerik SVG icon File. + // FileData = System.IO.File.ReadAllBytes("C:\\Documents\\MyWorkbook.xlsx"); + + await base.OnInitializedAsync(); + } + + private const string SampleExcelFile = ""; +} +```` + +## See Also + +* [Spreadsheet Overview](slug://spreadsheet-overview)