Class SpreadsheetBuilder
Inheritance
System.Object
SpreadsheetBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class SpreadsheetBuilder : ControlBuilder
Constructors
SpreadsheetBuilder()
Declaration
public SpreadsheetBuilder()
SpreadsheetBuilder(Spreadsheet)
Declaration
public SpreadsheetBuilder(Spreadsheet model)
Parameters
Fields
model
Declaration
Field Value
Properties
HtmlAttr
Declaration
public IDictionary<string, object> HtmlAttr { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
ID
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Output
Declaration
public override TextWriter Output { get; set; }
Property Value
Type |
Description |
System.IO.TextWriter |
|
Overrides
Methods
ActionBegin(String)
Triggers when the Spreadsheet actions (such as editing, formatting, sorting etc..) are starts.
Declaration
public SpreadsheetBuilder ActionBegin(string actionBegin)
Parameters
Type |
Name |
Description |
System.String |
actionBegin |
|
Returns
ActionComplete(String)
Triggers when the spreadsheet actions (such as editing, formatting, sorting etc..) gets completed.
Declaration
public SpreadsheetBuilder ActionComplete(string actionComplete)
Parameters
Type |
Name |
Description |
System.String |
actionComplete |
|
Returns
ActiveSheetIndex(Int32)
Specifies the active sheet index in the workbook.
Declaration
public SpreadsheetBuilder ActiveSheetIndex(int activeSheetIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
activeSheetIndex |
|
Returns
AfterHyperlinkClick(String)
Triggers when the Hyperlink function gets completed.
Declaration
public SpreadsheetBuilder AfterHyperlinkClick(string afterHyperlinkClick)
Parameters
Type |
Name |
Description |
System.String |
afterHyperlinkClick |
|
Returns
AfterHyperlinkCreate(String)
Triggers after the hyperlink inserted.
Declaration
public SpreadsheetBuilder AfterHyperlinkCreate(string afterHyperlinkCreate)
Parameters
Type |
Name |
Description |
System.String |
afterHyperlinkCreate |
|
Returns
AllowAutoFill(Boolean)
It allows to enable/disable AutoFill functionalities.
Declaration
public SpreadsheetBuilder AllowAutoFill(bool allowAutoFill = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowAutoFill |
|
Returns
It allows you to apply styles (font size, font weight, font family, fill color, and more) to the spreadsheet cells.
Declaration
public SpreadsheetBuilder AllowCellFormatting(bool allowCellFormatting = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowCellFormatting |
|
Returns
AllowChart(Boolean)
It allows you to insert the chart in a spreadsheet.
Declaration
public SpreadsheetBuilder AllowChart(bool allowChart = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowChart |
|
Returns
It allows you to apply conditional formatting to the sheet.
Declaration
public SpreadsheetBuilder AllowConditionalFormat(bool allowConditionalFormat = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowConditionalFormat |
|
Returns
AllowDataValidation(Boolean)
It allows you to apply data validation to the spreadsheet cells.
Declaration
public SpreadsheetBuilder AllowDataValidation(bool allowDataValidation = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowDataValidation |
|
Returns
AllowDelete(Boolean)
It allows you to delete rows, columns, and sheets from a spreadsheet.
Declaration
public SpreadsheetBuilder AllowDelete(bool allowDelete = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowDelete |
|
Returns
AllowEditing(Boolean)
It allows you to add new data or update existing cell data. If it is false, it will act as read only mode.
Declaration
public SpreadsheetBuilder AllowEditing(bool allowEditing = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowEditing |
|
Returns
AllowFiltering(Boolean)
It allows to enable/disable filter and its functionalities.
Declaration
public SpreadsheetBuilder AllowFiltering(bool allowFiltering = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowFiltering |
|
Returns
AllowFindAndReplace(Boolean)
It allows to enable/disable find and replace with its functionalities.
Declaration
public SpreadsheetBuilder AllowFindAndReplace(bool allowFindAndReplace = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowFindAndReplace |
|
Returns
AllowFreezePane(Boolean)
It allows to enable/disable freeze pane functionality in spreadsheet.
Declaration
public SpreadsheetBuilder AllowFreezePane(bool allowFreezePane = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowFreezePane |
|
Returns
AllowHyperlink(Boolean)
It allows to enable/disable Hyperlink and its functionalities.
Declaration
public SpreadsheetBuilder AllowHyperlink(bool allowHyperlink = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowHyperlink |
|
Returns
AllowImage(Boolean)
It allows you to insert the image in a spreadsheet.
Declaration
public SpreadsheetBuilder AllowImage(bool allowImage = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowImage |
|
Returns
AllowInsert(Boolean)
It allows you to insert rows, columns, and sheets into the spreadsheet.
Declaration
public SpreadsheetBuilder AllowInsert(bool allowInsert = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowInsert |
|
Returns
AllowMerge(Boolean)
It allows you to merge the range of cells.
Declaration
public SpreadsheetBuilder AllowMerge(bool allowMerge = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowMerge |
|
Returns
It allows formatting a raw number into different types of formats (number, currency, accounting, percentage, short date,
long date, time, fraction, scientific, and text) with built-in format codes.
Declaration
public SpreadsheetBuilder AllowNumberFormatting(bool allowNumberFormatting = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowNumberFormatting |
|
Returns
AllowOpen(Boolean)
It allows you to open an Excel file (.xlsx, .xls, and .csv) in Spreadsheet.
Declaration
public SpreadsheetBuilder AllowOpen(bool allowOpen = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowOpen |
|
Returns
AllowResizing(Boolean)
If allowResizing
is set to true, spreadsheet columns and rows can be resized.
Declaration
public SpreadsheetBuilder AllowResizing(bool allowResizing = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowResizing |
|
Returns
AllowSave(Boolean)
It allows you to save Spreadsheet with all data as Excel file (.xlsx, .xls, and .csv).
Declaration
public SpreadsheetBuilder AllowSave(bool allowSave = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowSave |
|
Returns
It specifies whether the Spreadsheet should be rendered with scrolling or not.
To customize the Spreadsheet scrolling behavior, use the scrollSettings
property.
Declaration
public SpreadsheetBuilder AllowScrolling(bool allowScrolling = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowScrolling |
|
Returns
AllowSorting(Boolean)
It allows to enable/disable sort and its functionalities.
Declaration
public SpreadsheetBuilder AllowSorting(bool allowSorting = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowSorting |
|
Returns
AllowUndoRedo(Boolean)
It allows to enable/disable undo and redo functionalities.
Declaration
public SpreadsheetBuilder AllowUndoRedo(bool allowUndoRedo = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowUndoRedo |
|
Returns
AllowWrap(Boolean)
It allows to enable/disable wrap text feature. By using this feature the wrapping applied cell text can wrap to the next line,
if the text width exceeds the column width.
Declaration
public SpreadsheetBuilder AllowWrap(bool allowWrap = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowWrap |
|
Returns
AutoFillSettings(Object)
Configures the auto fill settings.
Declaration
public SpreadsheetBuilder AutoFillSettings(object autoFillSettings)
Parameters
Type |
Name |
Description |
System.Object |
autoFillSettings |
|
Returns
Triggers before the cell format applied to the cell.
Declaration
public SpreadsheetBuilder BeforeCellFormat(string beforeCellFormat)
Parameters
Type |
Name |
Description |
System.String |
beforeCellFormat |
|
Returns
BeforeCellRender(String)
Triggers before the cell appended to the DOM.
Declaration
public SpreadsheetBuilder BeforeCellRender(string beforeCellRender)
Parameters
Type |
Name |
Description |
System.String |
beforeCellRender |
|
Returns
BeforeCellSave(String)
Triggers when before the cell is saved.
Declaration
public SpreadsheetBuilder BeforeCellSave(string beforeCellSave)
Parameters
Type |
Name |
Description |
System.String |
beforeCellSave |
|
Returns
BeforeCellUpdate(String)
Triggers before changing any cell properties.
Declaration
public SpreadsheetBuilder BeforeCellUpdate(string beforeCellUpdate)
Parameters
Type |
Name |
Description |
System.String |
beforeCellUpdate |
|
Returns
Triggers before apply or remove the conditional format from a cell in a range.
Declaration
public SpreadsheetBuilder BeforeConditionalFormat(string beforeConditionalFormat)
Parameters
Type |
Name |
Description |
System.String |
beforeConditionalFormat |
|
Returns
BeforeDataBound(String)
Triggers before the data is populated to the worksheet.
Declaration
public SpreadsheetBuilder BeforeDataBound(string beforeDataBound)
Parameters
Type |
Name |
Description |
System.String |
beforeDataBound |
|
Returns
BeforeHyperlinkClick(String)
Triggers when the Hyperlink is clicked.
Declaration
public SpreadsheetBuilder BeforeHyperlinkClick(string beforeHyperlinkClick)
Parameters
Type |
Name |
Description |
System.String |
beforeHyperlinkClick |
|
Returns
BeforeHyperlinkCreate(String)
Triggers before insert a hyperlink.
Declaration
public SpreadsheetBuilder BeforeHyperlinkCreate(string beforeHyperlinkCreate)
Parameters
Type |
Name |
Description |
System.String |
beforeHyperlinkCreate |
|
Returns
BeforeOpen(String)
Triggers before opening an Excel file.
Declaration
public SpreadsheetBuilder BeforeOpen(string beforeOpen)
Parameters
Type |
Name |
Description |
System.String |
beforeOpen |
|
Returns
BeforeSave(String)
Triggers before saving the Spreadsheet as Excel file.
Declaration
public SpreadsheetBuilder BeforeSave(string beforeSave)
Parameters
Type |
Name |
Description |
System.String |
beforeSave |
|
Returns
BeforeSelect(String)
Triggers before the cell or range of cells being selected.
Declaration
public SpreadsheetBuilder BeforeSelect(string beforeSelect)
Parameters
Type |
Name |
Description |
System.String |
beforeSelect |
|
Returns
BeforeSort(String)
Triggers before sorting the specified range.
Declaration
public SpreadsheetBuilder BeforeSort(string beforeSort)
Parameters
Type |
Name |
Description |
System.String |
beforeSort |
|
Returns
CellEdit(String)
Triggers when the cell is being edited.
Declaration
public SpreadsheetBuilder CellEdit(string cellEdit)
Parameters
Type |
Name |
Description |
System.String |
cellEdit |
|
Returns
CellEditing(String)
Triggers every time a request is made to access cell information.
This will be triggered when editing a cell.
Declaration
public SpreadsheetBuilder CellEditing(string cellEditing)
Parameters
Type |
Name |
Description |
System.String |
cellEditing |
|
Returns
CellSave(String)
Triggers when the edited cell is saved.
Declaration
public SpreadsheetBuilder CellSave(string cellSave)
Parameters
Type |
Name |
Description |
System.String |
cellSave |
|
Returns
CellStyle(SpreadsheetCommonCellStyle)
Specifies the cell style options.
Declaration
public SpreadsheetBuilder CellStyle(SpreadsheetCommonCellStyle cellStyle)
Parameters
Returns
CellStyle(Action<SpreadsheetCellStyleBuilder>)
Declaration
public SpreadsheetBuilder CellStyle(Action<SpreadsheetCellStyleBuilder> cellStyle)
Parameters
Returns
Triggers before closing the context menu.
Declaration
public SpreadsheetBuilder ContextMenuBeforeClose(string contextMenuBeforeClose)
Parameters
Type |
Name |
Description |
System.String |
contextMenuBeforeClose |
|
Returns
Triggers before opening the context menu and it allows customizing the menu items.
Declaration
public SpreadsheetBuilder ContextMenuBeforeOpen(string contextMenuBeforeOpen)
Parameters
Type |
Name |
Description |
System.String |
contextMenuBeforeOpen |
|
Returns
Triggers when the context menu item is selected.
Declaration
public SpreadsheetBuilder ContextMenuItemSelect(string contextMenuItemSelect)
Parameters
Type |
Name |
Description |
System.String |
contextMenuItemSelect |
|
Returns
Created(String)
Triggers when the component is created.
Declaration
public SpreadsheetBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
CssClass(String)
To specify a CSS class or multiple CSS class separated by a space, add it in the Spreadsheet root element.
This allows you to customize the appearance of component.
Declaration
public SpreadsheetBuilder CssClass(string cssClass)
Parameters
Type |
Name |
Description |
System.String |
cssClass |
|
Returns
DataBound(String)
Triggers when the data is populated in the worksheet.
Declaration
public SpreadsheetBuilder DataBound(string dataBound)
Parameters
Type |
Name |
Description |
System.String |
dataBound |
|
Returns
DataSourceChanged(String)
Triggers during data changes when the data is provided as dataSource
in the Spreadsheet.
Declaration
public SpreadsheetBuilder DataSourceChanged(string dataSourceChanged)
Parameters
Type |
Name |
Description |
System.String |
dataSourceChanged |
|
Returns
DefinedNames(Action<DefinedNameBuilder>)
Declaration
public SpreadsheetBuilder DefinedNames(Action<DefinedNameBuilder> definedNames)
Parameters
Returns
DefinedNames(List<DefinedName>)
Specifies the name of a range and uses it in a formula for calculation.
Declaration
public SpreadsheetBuilder DefinedNames(List<DefinedName> definedNames)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<DefinedName> |
definedNames |
|
Returns
DialogBeforeOpen(String)
Triggers before opening the dialog box.
Declaration
public SpreadsheetBuilder DialogBeforeOpen(string dialogBeforeOpen)
Parameters
Type |
Name |
Description |
System.String |
dialogBeforeOpen |
|
Returns
EnableClipboard(Boolean)
It enables or disables the clipboard operations (cut, copy, and paste) of the Spreadsheet.
Declaration
public SpreadsheetBuilder EnableClipboard(bool enableClipboard = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableClipboard |
|
Returns
It enables or disables the context menu option of spreadsheet. By default, context menu will opens for row header,
column header, sheet tabs, and cell.
Declaration
public SpreadsheetBuilder EnableContextMenu(bool enableContextMenu = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableContextMenu |
|
Returns
EnableKeyboardNavigation(Boolean)
It allows you to interact with cell, sheet tabs, formula bar, and ribbon through the keyboard device.
Declaration
public SpreadsheetBuilder EnableKeyboardNavigation(bool enableKeyboardNavigation = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableKeyboardNavigation |
|
Returns
EnableKeyboardShortcut(Boolean)
It enables shortcut keys to perform Spreadsheet operations like open, save, copy, paste, and more.
Declaration
public SpreadsheetBuilder EnableKeyboardShortcut(bool enableKeyboardShortcut = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableKeyboardShortcut |
|
Returns
EnablePersistence(Boolean)
Enable or disable persisting component's state between page reloads.
Declaration
public SpreadsheetBuilder EnablePersistence(bool enablePersistence = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enablePersistence |
|
Returns
EnableRtl(Boolean)
Enable or disable rendering component in right to left direction.
Declaration
public SpreadsheetBuilder EnableRtl(bool enableRtl = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableRtl |
|
Returns
Triggers before closing the file menu.
Declaration
public SpreadsheetBuilder FileMenuBeforeClose(string fileMenuBeforeClose)
Parameters
Type |
Name |
Description |
System.String |
fileMenuBeforeClose |
|
Returns
Triggers before opening the file menu.
Declaration
public SpreadsheetBuilder FileMenuBeforeOpen(string fileMenuBeforeOpen)
Parameters
Type |
Name |
Description |
System.String |
fileMenuBeforeOpen |
|
Returns
Triggers when the file menu item is selected.
Declaration
public SpreadsheetBuilder FileMenuItemSelect(string fileMenuItemSelect)
Parameters
Type |
Name |
Description |
System.String |
fileMenuItemSelect |
|
Returns
Height(Double)
Defines the height of the Spreadsheet. It accepts height as pixels, number, and percentage.
Declaration
public SpreadsheetBuilder Height(double height)
Parameters
Type |
Name |
Description |
System.Double |
height |
|
Returns
Height(String)
Defines the height of the Spreadsheet. It accepts height as pixels, number, and percentage.
Declaration
public SpreadsheetBuilder Height(string height)
Parameters
Type |
Name |
Description |
System.String |
height |
|
Returns
HtmlAttributes(Object)
Allows additional HTML attributes such as title, name, etc., and
accepts n number of attributes in a key-value pair format.
Declaration
public SpreadsheetBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
IsProtected(Boolean)
Specifies to protect the workbook.
Declaration
public SpreadsheetBuilder IsProtected(bool isProtected = true)
Parameters
Type |
Name |
Description |
System.Boolean |
isProtected |
|
Returns
Locale(String)
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public SpreadsheetBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
OpenComplete(String)
Triggers when the spreadsheet importing gets completed.
Declaration
public SpreadsheetBuilder OpenComplete(string openComplete)
Parameters
Type |
Name |
Description |
System.String |
openComplete |
|
Returns
OpenFailure(String)
Triggers when the opened Excel file fails to load.
Declaration
public SpreadsheetBuilder OpenFailure(string openFailure)
Parameters
Type |
Name |
Description |
System.String |
openFailure |
|
Returns
OpenUrl(String)
Specifies the service URL to open excel file in spreadsheet.
Declaration
public SpreadsheetBuilder OpenUrl(string openUrl)
Parameters
Type |
Name |
Description |
System.String |
openUrl |
|
Returns
Password(String)
Declaration
public SpreadsheetBuilder Password(string password)
Parameters
Type |
Name |
Description |
System.String |
password |
|
Returns
QueryCellInfo(String)
Triggered every time a request is made to access cell information.
Declaration
public SpreadsheetBuilder QueryCellInfo(string queryCellInfo)
Parameters
Type |
Name |
Description |
System.String |
queryCellInfo |
|
Returns
Render()
Declaration
public HtmlString Render()
Returns
Type |
Description |
Microsoft.AspNetCore.Html.HtmlString |
|
SaveComplete(String)
Triggers after saving the Spreadsheet as Excel file.
Declaration
public SpreadsheetBuilder SaveComplete(string saveComplete)
Parameters
Type |
Name |
Description |
System.String |
saveComplete |
|
Returns
SaveUrl(String)
Specifies the service URL to save spreadsheet as Excel file.
Declaration
public SpreadsheetBuilder SaveUrl(string saveUrl)
Parameters
Type |
Name |
Description |
System.String |
saveUrl |
|
Returns
Configures the scroll settings.
Declaration
public SpreadsheetBuilder ScrollSettings(SpreadsheetScrollSettings scrollSettings)
Parameters
Returns
Declaration
public SpreadsheetBuilder ScrollSettings(Action<SpreadsheetScrollSettingsBuilder> scrollSettings)
Parameters
Returns
Select(String)
Triggers after the cell or range of cells is selected.
Declaration
public SpreadsheetBuilder Select(string select)
Parameters
Type |
Name |
Description |
System.String |
select |
|
Returns
SelectionSettings(SpreadsheetSelectionSettings)
Configures the selection settings.
Declaration
public SpreadsheetBuilder SelectionSettings(SpreadsheetSelectionSettings selectionSettings)
Parameters
Returns
SelectionSettings(Action<SpreadsheetSelectionSettingsBuilder>)
Declaration
public SpreadsheetBuilder SelectionSettings(Action<SpreadsheetSelectionSettingsBuilder> selectionSettings)
Parameters
Returns
Sheets(Action<SheetBuilder>)
Declaration
public SpreadsheetBuilder Sheets(Action<SheetBuilder> sheets)
Parameters
Returns
Sheets(List<Sheet>)
Configures sheets and its options.
Declaration
public SpreadsheetBuilder Sheets(List<Sheet> sheets)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<Sheet> |
sheets |
|
Returns
ShowAggregate(Boolean)
If showAggregate
is set to true, spreadsheet will show the AVERAGE, SUM, COUNT, MIN and MAX values based on the selected cells.
Declaration
public SpreadsheetBuilder ShowAggregate(bool showAggregate = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showAggregate |
|
Returns
It shows or hides the formula bar and its features.
Declaration
public SpreadsheetBuilder ShowFormulaBar(bool showFormulaBar = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showFormulaBar |
|
Returns
ShowRibbon(Boolean)
It shows or hides the ribbon in spreadsheet.
Declaration
public SpreadsheetBuilder ShowRibbon(bool showRibbon = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showRibbon |
|
Returns
ShowSheetTabs(Boolean)
It shows or hides the sheets tabs, this is used to navigate among the sheets and create or delete sheets by UI interaction.
Declaration
public SpreadsheetBuilder ShowSheetTabs(bool showSheetTabs = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showSheetTabs |
|
Returns
SortComplete(String)
Triggers after sorting action is completed.
Declaration
public SpreadsheetBuilder SortComplete(string sortComplete)
Parameters
Type |
Name |
Description |
System.String |
sortComplete |
|
Returns
Width(Double)
Defines the width of the Spreadsheet. It accepts width as pixels, number, and percentage.
Declaration
public SpreadsheetBuilder Width(double width)
Parameters
Type |
Name |
Description |
System.Double |
width |
|
Returns
Width(String)
Defines the width of the Spreadsheet. It accepts width as pixels, number, and percentage.
Declaration
public SpreadsheetBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns