SharpCell.Grid

SheetTabs

public class SheetTabs : UserControl

Namespace SharpCell.Grid.Avalonia · package SharpCell.Grid.Avalonia

Excel's sheet tabs for a SpreadsheetView: a tab for each sheet of the view's workbook, the shown one highlighted. Clicking a tab shows its sheet, and the + button adds a sheet, as in Excel. Put it under the view, as Excel does.

Constructors

SheetTabs()

public SheetTabs()

Tabs for no view; set SheetTabs.View to connect them.

Properties

SheetNames

public IReadOnlyList<string> SheetNames { get; }

The names on the tabs, in the workbook's order.

View

public SpreadsheetView? View { get; set; }

The view whose workbook's sheets the tabs show and switch.

Methods

AddSheet()

public Worksheet? AddSheet()

Adds a sheet after the others, named as Excel names a new sheet (Sheet2, Sheet3, the first number free), and shows it. Null when the view is read-only or has no sheet.

Refresh()

public void Refresh()

Shows the tabs again from the workbook's sheets, after sheets were added in code.