Class GridDesktop

GridDesktop class

Aspose GridDesktop class Represents a root object to create an GridDesktop control. To use this control, simply drag it from your toolbox to a form or usercontrol.

public class GridDesktop : UserControl

Constructors

NameDescription
GridDesktop()Aspose GridDesktop class

Properties

NameDescription
ActiveSheetIndex { get; set; }Gets or sets the selected sheet index.
ActiveSheetNameFont { get; set; }Gets or sets the active sheet displaying font of sheet bar.
AlwasysRecalculateAllFormulas { get; set; }Gets or sets a value indicating whether we need to run all formulas,as when we run all formulas, when update one cell value,and it affect others ,and others affect others ,more and more, cause the whole cells need recalculate ,just like the Butterfly Effect,it needs lots of stack opertation , it will get very low performance, like in CELLSNET-41921,this issue contains the very file that can show this scenario we’d better just run all formulas, ,as when run all formulas we may have some optimization.
BorderStyle { get; set; }Indicates the border style for the control.
ColumnHeaderVisible { get; set; }Gets or sets a value indicating whether column header is visible.
CommentDisplayingFont { get; set; }Gets or sets the default displaying font of comment text.
ContextMenuManager { get; }Gets the ContextMenuManager instance.
DefaultCellFont { get; set; }Gets or sets the default font of the cell
DefaultCellFontColor { get; set; }Gets or sets the default font color of the cell.
EnableClipboardCopyPaste { get; set; }Indicates whether to copy/paste based on clipboard,so that it can copy/paste with MS-EXCEL. It only copys/pastes cell value ,It does not copy any other setting of the cell like format,border style and so on The default value is false.
EnableCopyWithExtension { get; set; }Gets or sets a value indicating whether the copy operation will extend the number of rows or columns.
EnableCopyWithLockedOption { get; set; }Gets or sets a value indicating whether the copy operation will copy the style’s CellLocked attribute value of a cell.
EnableUndo { get; set; }Gets or sets a value indicating whether the Undo function is enabled. The default value is false.
GridMemorySetting { get; set; }Gets or sets memory option.
IsHorizontalScrollBarVisible { get; set; }Sets visible statue for Horizontal ScrollBar.
IsVerticalScrollBarVisible { get; set; }Sets visible statue for Vertical ScrollBar.
Names { get; }Gets the collection of all the Name objects in the spreadsheet.
PageRows { get; set; }Sets or Gets row size for Pagination.the maximum of PageRows supported is 100000,the maximum of page number supported is 5000.
PasteType { get; set; }Indicates which paste type when do paste action,only available when EnableClipboardCopyPaste is false .the default value is GridPasteType.Default;
R1C1 { get; set; }Gets or sets a value indicating whether the control using R1C1 reference style.
RecalculateFormulas { get; set; }Gets or sets a value indicating whether to recalculate all the cells’ formula when a cell’s value changed. The default value is true.
RowHeaderVisible { get; set; }Gets or sets a value indicating whether row header is visible.
SheetNameFont { get; set; }Gets or sets the default displaying font of sheet bar.
SheetsBarVisible { get; set; }Gets or sets a value indicating whether sheet bar is visible.
SheetTabWidth { get; set; }Sets /Gets width of Sheet Tab.
ShowContextMenu { get; set; }Gets or sets a value indicating whether the control can show context menu.
ShowFormulaWarning { get; set; }Sets/Gets whether to show the error or waring message for set cell formula value,the default value is true.
ShowNumberStoredAsTextSymbol { get; set; }Sets /Gets whether show the triangle symbol for the cell which contains number string but stored as text format
ShowStatus { get; set; }Gets or sets a value indicating whether to show the calculate status The default value is true.
UndoManager { get; }Gets the UndoManager instance.
Worksheets { get; }Gets the Worksheets.

Methods

NameDescription
Clear()Clears GridDesktop control.
Copy()Copies focused cell content to clipboard.
Cut()Cuts focused cell content to clipboard.
DoSplit()Sets Split view.
EndFormatPainter()Notifies GridDesktop to end FormatPainter.
ExportExcelFile(Stream)Exports to a excel file stream, including disk IO stream or memory stream.
ExportExcelFile(string)Exports to an excel file.
ExportExcelFile(Stream, FileFormatType)Exports to a excel file stream, including disk IO stream or memory stream.
ExportExcelFile(string, FileFormatType)Exports to a excel file.
ExportPdfFile(Stream, GridPdfSaveOptions)Exports to a pdf file stream, including disk IO stream or memory stream.
ExportPdfFile(string, GridPdfSaveOptions)Exports to a pdf file stream, including disk IO stream or memory stream.
GetActiveWorksheet()Gets current active worksheet.
getHScrollBar()return horizontal scroll bar
getVScrollBar()return vertical scroll bar
ImportExcelFile(Stream)Imports from an excel file stream, including disk file stream or memory stream.
ImportExcelFile(string)Imports from an excel file.
ImportExcelFile(Stream, bool)Imports from an excel file stream, including disk file stream or memory stream.
ImportExcelFile(string, bool)Imports from an excel file.
ImportExcelFile(string, int)Imports a worksheet from an excel file.
ImportExcelFile(Stream, string, string, bool, bool)Imports from an excel file.
ImportExcelFile(string, string, string, bool, bool)Imports from an excel file.
Invalidate()Override invalidate.
OpenFindReplaceDialog(bool)Opens the FindReplace dialog to find or replace cells.
Paste()Pastes clipboard content to focused cell.
RefreshControl()Refresh the GridDesktop control.
RunAllFormulas()Runs all the cells’s formula.
SetAllScrollBarsVisible()Sets all scrollbars visible.
SetCustomResourceManager(ResourceManager)Set custom resource manager to implement user defined localization
ShowStyleDialog()Opens a style dialog,to set cells style,font,colors etc.
StartFormatPainter(bool)Notifies GridDesktop to start FormatPainter.
UnDoSplit()Unset Split view.
static GetVersion()Get the release version.

Fields

NameDescription
LoadDataFilterthe options to filter data when loading workbook from template.
ShowImportMessagewether to show message box when fail to import the file ,the default value is true

Events

NameDescription
event AfterDeleteColumnsOccurs after column is deleted.
event AfterDeleteRowsOccurs after row is deleted.
event AfterInsertColumnsOccurs after new column is inserted.
event AfterInsertRowsOccurs after new row is inserted.
event BeforeCalculateOccurs before calculate formula in workbook.
event BeforeLoadFileOccurs before workbook loaded from file.
event CellButtonClickOccurs when the cell button clicked.
event CellCheckedChangedOccurs when the cell checkbox Checked property is changed.
event CellClickOccurs when the gridcell is clicked.
event CellComboBoxCopyOccurs when a grid cell ComboBox is being copied.
event CellDataChangedOccurs when the grid cell data property is changed.
event CellDoubleClickOccurs when the gridcell is double clicked.
event CellFormatChangedOccurs when the cell format is changed via Format Cells dialog box.
event CellKeyPressedOccurs when a key is pressed while a cell has focus.
event CellSelectedIndexChangedOccurs when the cell combobox SelectedIndex property has changed.
event CellTextBoxChangingOccurs when typing characters in a grid cell.
event CellValidationFailedOccurs when a grid cell validates failed.
event ColumnHeaderClickOccurs when the column header clicked.
event ColumnHeaderDoubleClickOccurs when the column header double clicked.
event CommentDataChangedOccurs when the comment data has changed.
event FailLoadFile
event FinishCalculateOccurs after calculate formula in workbook.
event FinishLoadFileOccurs when the workbook is loaded.
event FocusedCellChangedOccurs when the focused cell is changed.
event PictureClickOccurs when the shape is clicked.
event RowColumnHiddenChangedOccurs when the row/column hide status changed.
event RowFilteredEventOccurs after row filter item selected.
event RowHeaderClickOccurs when the row header clicked.
event RowHeaderDoubleClickOccurs when the row header double clicked.
event SelectedCellRangeChangedOccurs when the selected cellrange is changed.
event SelectedSheetIndexChangedOccurs when the SelectedSheetIndex property is changed.
event ShapeClickOccurs when the shape is clicked.

Remarks

Please refer to .NET SDK document about further information about System.Windows.Forms.UserControl.

Examples

[C#]
gridDesktop1.Worksheets[0].Cells[0, 0].Value = "2";
gridDesktop1.Worksheets[0].Cells[1, 0].Value = "3";
gridDesktop1.Worksheets[0].Cells[2, 1].Value = "=a1*a2";
gridDesktop1.RunAllFormulas();
gridDesktop1.Invalidate();

[Visual Basic]
gridDesktop1.Worksheets(0).Cells(0, 0).Value = "2"
gridDesktop1.Worksheets(0).Cells(1, 0).Value = "3"
gridDesktop1.Worksheets(0).Cells(2, 1).Value = "=a1*a2"
gridDesktop1.RunAllFormulas()
gridDesktop1.Invalidate()

See Also