Class WorksheetModel
Provides the data / model part for a worksheet in an Excel-like Workbook display. A WorksheetModel is a member of the Worksheets collection of a WorkbookModel.
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class WorksheetModel : Component, ISerializable
Remarks
This class can be serialized into a serialization stream.
Multiple WorkbookView controls can share the same WorkbookModel. Each WorksheetView that is displayed in a WorkbookView is associated with a WorksheetModel from the Worksheets collection in a WorkbookModel.
Constructors
WorksheetModel(WorkbookModel, String)
Initializes a new WorksheetModel and associates it with a WorkbookModel.
Declaration
public WorksheetModel(WorkbookModel workbook, string name)
Parameters
Type | Name | Description |
---|---|---|
WorkbookModel | workbook | The WorkbookModel this sheet belongs to. |
System.String | name | The name of this sheet. |
WorksheetModel(WorkbookModel, String, Object)
Initializes a new WorksheetModel and associates it with a WorkbookModel.
Declaration
public WorksheetModel(WorkbookModel workbook, string name, object content)
Parameters
Type | Name | Description |
---|---|---|
WorkbookModel | workbook | The WorkbookModel this sheet belongs to. |
System.String | name | The name of this sheet. |
System.Object | content | The object with data to be displayed in this control, e.g. a Syncfusion.Windows.Forms.Grid.GridModel with grid data. The object should implement ICreateControl the interface and be able to create a System.Windows.Forms.Control object to be displayed as pane in a WorkbookView. langword_csharp_Syncfusion.Windows.Forms.Grid.GridModel will create a langword_csharp_Syncfusion.Windows.Forms.Grid.GridControlBase for example. |
WorksheetModel(SerializationInfo, StreamingContext)
Initializes a new WorksheetModel from a serialization stream.
Declaration
protected WorksheetModel(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or deserialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Properties
Content
Gets / sets the object with data to be displayed in this control, e.g. a Syncfusion.Windows.Forms.Grid.GridModel with grid data. The object should implement ICreateControl interface and be able to create a System.Windows.Forms.Control object to be displayed as pane in a WorkbookView. langword_csharp_Syncfusion.Windows.Forms.Grid.GridModel will create a langword_csharp_Syncfusion.Windows.Forms.Grid.GridControlBase for example.
Declaration
public object Content { get; set; }
Property Value
Type |
---|
System.Object |
Name
Gets / sets the name of this worksheet.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
System.String |
ToolTipText
Gets / sets the ToolTip text for the tab that will appear when the mouse hovers over the tab and the TabBarSplitterControl's showToolTips property is True.
Declaration
public string ToolTipText { get; set; }
Property Value
Type |
---|
System.String |
Visible
Indicates whether this worksheet is visible in the parent workbook.
Declaration
public bool Visible { get; set; }
Property Value
Type |
---|
System.Boolean |
Workbook
Returns the WorkbookModel this sheet is associated with.
Declaration
public WorkbookModel Workbook { get; }
Property Value
Type |
---|
WorkbookModel |
Methods
CreateControl()
Creates the System.Windows.Forms.Control that knows how to display the Syncfusion.Windows.Forms.WorksheetModel.content in a form.
Declaration
public Control CreateControl()
Returns
Type | Description |
---|---|
System.Windows.Forms.Control | The System.Windows.Forms.Control to be displayed in the WorksheetView |
Remarks
The Syncfusion.Windows.Forms.WorksheetModel.content object should implement ICreateControl interface and be able to create a System.Windows.Forms.Control object to be displayed as pane in a WorkbookView. langword_csharp_Syncfusion.Windows.Forms.Grid.GridModel will create a langword_csharp_Syncfusion.Windows.Forms.Grid.GridControlBase for example.
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
OnContentChanged(EventArgs)
Occurs when the Syncfusion.Windows.Forms.WorksheetModel.content property is changed.
Declaration
protected virtual void OnContentChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | EventArgs.Empty. |
OnNameChanged(EventArgs)
Raises the NameChanged event.
Declaration
protected virtual void OnNameChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | EventArgs.Empty. |
OnToolTipTextChanged(EventArgs)
Raises the ToolTipTextChanged event.
Declaration
protected virtual void OnToolTipTextChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnVisibleChanged(EventArgs)
Raises the VisibleChanged event.
Declaration
protected virtual void OnVisibleChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | EventArgs.Empty. |
Events
ContentChanged
Occurs when the Content property is changed.
Declaration
public event EventHandler ContentChanged
Event Type
Type |
---|
System.EventHandler |
NameChanged
Occurs when the Name is changed.
Declaration
public event EventHandler NameChanged
Event Type
Type |
---|
System.EventHandler |
ToolTipTextChanged
Occurs when the ToolTipText is changed.
Declaration
public event EventHandler ToolTipTextChanged
Event Type
Type |
---|
System.EventHandler |
VisibleChanged
Occurs when the Visible property is changed.
Declaration
public event EventHandler VisibleChanged
Event Type
Type |
---|
System.EventHandler |
Explicit Interface Implementations
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |