Class WorkbookView
Provides functionality for displaying several WorksheetView controls in an Excel-like workbook.
Implements
System.Windows.Forms.IContainerControl
Inherited Members
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class WorkbookView : TabBarSplitterControl, IControlToolTipProvider, IInternalSplitterParent, IScrollBarFrame, IDynamicSplitterFrame, IThemedControl, IContainerControl, INonClientPaintingSupport, IThemeProvider, IVisualStyle
Remarks
A WorkbookView is associated with a WorkbookModel. The WorkbookModel has a Worksheets collection. For each of the WorksheetModel objects in the Worksheets collection of the WorkbookModel, a WorksheetView is created and displayed in this WorkbookView.
Examples
public class NewWorkbookFile : BasicAction
{
int windowCount = 0;
WorkbookModel workbook;
public override void InvokeAction(object sender, EventArgs e)
{
windowCount++;
workbook = new WorkbookModel("Workbook");
GridModel sheet1 = new GridModel();
SampleGrid.SetupGridModel(sheet1);
GridModel sheet2 = new GridModel();
SampleGrid.SetupGridModel(sheet2);
workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 1", sheet1));
workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 2", sheet2));
WorkbookForm doc = new WorkbookForm(workbook);
doc.Text = workbook.Name + windowCount;
doc.MdiParent = MainWindow;
doc.Show();
}
}
Constructors
WorkbookView(WorkbookModel)
Initializes a new WorkbookView for the specified WorkbookModel.
Declaration
public WorkbookView(WorkbookModel workbook)
Parameters
Type | Name | Description |
---|---|---|
WorkbookModel | workbook | The WorkbookModel which holds data to be displayed in this view. |
Properties
Workbook
Returns the WorkbookModel which holds data to be displayed in this view.
Declaration
public WorkbookModel Workbook { get; }
Property Value
Type |
---|
WorkbookModel |
Methods
CreateControlsInstance()
Declaration
protected override Control.ControlCollection CreateControlsInstance()
Returns
Type |
---|
System.Windows.Forms.Control.ControlCollection |
Overrides
OnCreateTabBarPageCollection()
Creates the WorksheetViewCollection.
Declaration
public override TabBarPageCollection OnCreateTabBarPageCollection()
Returns
Type | Description |
---|---|
TabBarPageCollection | The new WorksheetViewCollection. |
Overrides
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
TabsMoving(Object, TabMovedEventArgs)
Declaration
protected override void TabsMoving(object sender, TabMovedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
TabMovedEventArgs | e |
Overrides
Events
Activated
Occurs when the view is activated.
Declaration
public event EventHandler Activated
Event Type
Type |
---|
System.EventHandler |
Implements
System.Windows.Forms.IContainerControl