Class NoxGridBook
Workbook control that switches between multiple sheets (one NoxGrid each) with tabs at the bottom.
book.Sheets.Add("Orders"), book.ActiveGrid, book.ExportToExcel("orders.xlsx") (one Excel sheet per sheet).
[ToolboxBitmap(typeof(NoxGrid), "NoxGrid.bmp")]
[Docking(DockingBehavior.Ask)]
public class NoxGridBook : Control, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
- Inheritance
-
NoxGridBook
- Implements
- Inherited Members
Constructors
NoxGridBook()
Creates an empty book.
public NoxGridBook()
Properties
ActiveGrid
Gets the grid of the active sheet (null if none).
[Browsable(false)]
public NoxGrid ActiveGrid { get; }
Property Value
ActiveSheet
Gets or sets the active sheet (null if none).
[Browsable(false)]
public NoxGridSheet ActiveSheet { get; set; }
Property Value
ActiveSheetIndex
Index of the active sheet. Default: 0.
public int ActiveSheetIndex { get; set; }
Property Value
AllowUserToAddSheets
Allows adding sheets with the [+] button next to the tabs. Default: True.
public bool AllowUserToAddSheets { get; set; }
Property Value
AllowUserToDeleteSheets
Allows deleting sheets from the tab context menu. Default: True.
public bool AllowUserToDeleteSheets { get; set; }
Property Value
AllowUserToMoveSheets
Allows reordering sheets by dragging tabs. Default: True.
public bool AllowUserToMoveSheets { get; set; }
Property Value
AllowUserToRenameSheets
Allows renaming a sheet by double-clicking its tab. Default: True.
public bool AllowUserToRenameSheets { get; set; }
Property Value
DefaultSize
protected override Size DefaultSize { get; }
Property Value
Sheets
Gets the sheet collection (order of NoxGridSheet in Controls).
[Browsable(false)]
public NoxGridSheetCollection Sheets { get; }
Property Value
ShowTabs
Shows the sheet tabs at the bottom. Default: True.
public bool ShowTabs { get; set; }
Property Value
TabHeight
Sheet tab height (px at 96 DPI). Default: 26.
public int TabHeight { get; set; }
Property Value
Methods
BeginRename(int)
Renames a sheet by showing an input box over its tab.
public void BeginRename(int index)
Parameters
indexint
CreatePrintDocument(bool)
Document for printing. allSheets = True prints all sheets; False prints the active sheet.
public PrintDocument CreatePrintDocument(bool allSheets)
Parameters
allSheetsbool
Returns
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposingbool
ExportToExcel(Stream, NoxExportOptions)
Writes every sheet as one Excel file (.xlsx) to a stream.
public void ExportToExcel(Stream stream, NoxExportOptions options)
Parameters
streamStreamoptionsNoxExportOptions
ExportToExcel(string)
Exports all sheets to one Excel file (one Excel sheet per sheet).
public void ExportToExcel(string path)
Parameters
pathstring
ExportToExcel(string, NoxExportOptions)
Saves every sheet as one Excel file (.xlsx).
public void ExportToExcel(string path, NoxExportOptions options)
Parameters
pathstringoptionsNoxExportOptions
ImportFromExcel(Stream, NoxImportOptions)
Imports all sheets of an Excel workbook. Existing sheets are removed and a sheet is created for each Excel sheet. Formulas that refer to other sheets are imported as is.
public void ImportFromExcel(Stream stream, NoxImportOptions options)
Parameters
streamStreamoptionsNoxImportOptions
ImportFromExcel(string)
Loads every sheet of an Excel file (.xlsx) as sheets of this book, with default options.
public void ImportFromExcel(string path)
Parameters
pathstring
ImportFromExcel(string, NoxImportOptions)
Loads every sheet of an Excel file (.xlsx) as sheets of this book.
public void ImportFromExcel(string path, NoxImportOptions options)
Parameters
pathstringoptionsNoxImportOptions
OnActiveSheetChanged(EventArgs)
Raises the ActiveSheetChanged event.
protected virtual void OnActiveSheetChanged(EventArgs e)
Parameters
OnControlAdded(ControlEventArgs)
Raises the ControlAdded event.
protected override void OnControlAdded(ControlEventArgs e)
Parameters
OnControlRemoved(ControlEventArgs)
Raises the ControlRemoved event.
protected override void OnControlRemoved(ControlEventArgs e)
Parameters
OnFontChanged(EventArgs)
Raises the FontChanged event.
protected override void OnFontChanged(EventArgs e)
Parameters
OnLayout(LayoutEventArgs)
Raises the Layout event.
protected override void OnLayout(LayoutEventArgs levent)
Parameters
leventLayoutEventArgs
OnMouseCaptureChanged(EventArgs)
Raises the MouseCaptureChanged event.
protected override void OnMouseCaptureChanged(EventArgs e)
Parameters
OnMouseDoubleClick(MouseEventArgs)
Raises the MouseDoubleClick event.
protected override void OnMouseDoubleClick(MouseEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Raises the MouseDown event.
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseMove(MouseEventArgs)
Raises the MouseMove event.
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Raises the MouseUp event.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnPaint(PaintEventArgs)
Raises the Paint event.
protected override void OnPaint(PaintEventArgs e)
Parameters
PrintAll(bool)
Prints all sheets (showDialog = True shows the printer selection dialog).
public void PrintAll(bool showDialog)
Parameters
showDialogbool
PrintPreview()
Print preview of the active sheet.
public void PrintPreview()
PrintPreviewAll()
Print preview of all sheets.
public void PrintPreviewAll()
ProcessCmdKey(ref Message, Keys)
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameters
Returns
Events
ActiveSheetChanged
Occurs when the active sheet changes.
public event EventHandler ActiveSheetChanged