New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Spreadsheet

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class SpreadsheetBuilder : WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>SpreadsheetBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ToComponent()WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.Expression(string)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.Name(string)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.Deferred(bool)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.HtmlAttributes(object)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.Render()WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ToHtmlString()WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ToClientTemplate()WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.AsModule(bool)WidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ComponentWidgetBuilderBase<Spreadsheet, SpreadsheetBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the SpreadsheetBuilder class.

C#
public SpreadsheetBuilder(Spreadsheet component)
Parameters:componentSpreadsheet

Methods

The name of the currently active sheet. Must exactly match one of the (sheet names)[#configuration-sheets.name].

C#
public SpreadsheetBuilder ActiveSheet(string value)
Parameters:valuestring

The value for ActiveSheet

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.ActiveSheet("Sheet2")
)

Binds the Spreadsheet to a dictionary containing the workbook settings.

C#
public SpreadsheetBuilder BindTo(Dictionary<string, object> workbook)
Parameters:workbookDictionary<string, object>

The workbook settings

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Binds the Spreadsheet to a collection of SpreadsheetSheet objects.

C#
public SpreadsheetBuilder BindTo(IEnumerable<SpreadsheetSheet> value)
Parameters:valueIEnumerable<SpreadsheetSheet>Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

The number of columns in the document.

C#
public SpreadsheetBuilder Columns(double value)
Parameters:valuedouble

The value for Columns

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Columns(10)
)

The default column width in pixels.

C#
public SpreadsheetBuilder ColumnWidth(double value)
Parameters:valuedouble

The value for ColumnWidth

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.ColumnWidth(100)
)

The default cell styles that will be applied to the sheet cells.

C#
public SpreadsheetBuilder DefaultCellStyle(Action<SpreadsheetDefaultCellStyleSettingsBuilder> configurator)
Parameters:configuratorAction<SpreadsheetDefaultCellStyleSettingsBuilder>

The SpreadsheetDefaultCellStyleSettingsBuilder for the defaultcellstyle setting.

Returns:

SpreadsheetBuilder

Returns the current instance of SpreadsheetBuilder .

Configures the client-side events.

C#
public SpreadsheetBuilder Events(Action<SpreadsheetEventBuilder> configurator)
Parameters:configuratorAction<SpreadsheetEventBuilder>

The client events action.

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@(Html.Kendo().Spreadsheet()
.Name("Spreadsheet")
.Events(events =&gt; events
.InsertSheet("onInsertSheet")
)
)

Configures the Excel export settings of the Spreadsheet.

C#
public SpreadsheetBuilder Excel(Action<SpreadsheetExcelSettingsBuilder> configurator)
Parameters:configuratorAction<SpreadsheetExcelSettingsBuilder>

The SpreadsheetExcelSettingsBuilder for the excel setting.

Returns:

SpreadsheetBuilder

Returns the current instance of SpreadsheetBuilder .

The height of the header row in pixels.

C#
public SpreadsheetBuilder HeaderHeight(double value)
Parameters:valuedouble

The value for HeaderHeight

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.HeaderHeight(50)
)

The width of the header column in pixels.

C#
public SpreadsheetBuilder HeaderWidth(double value)
Parameters:valuedouble

The value for HeaderWidth

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.HeaderWidth(100)
)

An object containing any images used in the Spreadsheet. The keys should be image ID-s (they are referenced by this ID in (sheets.drawings)[#configuration-sheets.drawings]) and the values should be image URLs.The image URLs can be eitherdata URLs, in which case the images are fully contained by the JSON, or can be external URLs.Note that when external URLs are used, they should reside on the same domain, or the server must be configured with the properCORS headers, for the Spreadsheet to be able to fetch binary image data using a XMLHttpRequest. If it cannot fetch the image, export to Excel or PDF might not work.

C#
public SpreadsheetBuilder Images(object value)
Parameters:valueobject

The value for Images

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Images(new { testImage = "../images/image1.png" })
)

Configures the PDF export settings of the Spreadsheet.

C#
public SpreadsheetBuilder Pdf(Action<SpreadsheetPdfSettingsBuilder> configurator)
Parameters:configuratorAction<SpreadsheetPdfSettingsBuilder>

The SpreadsheetPdfSettingsBuilder for the pdf setting.

Returns:

SpreadsheetBuilder

Returns the current instance of SpreadsheetBuilder .

The default row height in pixels.

C#
public SpreadsheetBuilder RowHeight(double value)
Parameters:valuedouble

The value for RowHeight

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.RowHeight(30)
)

The number of rows in the document.

C#
public SpreadsheetBuilder Rows(double value)
Parameters:valuedouble

The value for Rows

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Rows(50)
)

An array which defins the document sheets and their content.

C#
public SpreadsheetBuilder Sheets(Action<SpreadsheetSheetFactory> configurator)
Parameters:configuratorAction<SpreadsheetSheetFactory>

The SpreadsheetSheetFactory for the sheets setting.

Returns:

SpreadsheetBuilder

Returns the current instance of SpreadsheetBuilder .

A Boolean value which indicates if the sheets-bar will be displayed.

C#
public SpreadsheetBuilder Sheetsbar(bool value)
Parameters:valuebool

The value for Sheetsbar

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheetsbar(false)
)

A Boolean value which indicates if the toolbar will be displayed.

C#
public SpreadsheetBuilder Toolbar(Action<SpreadsheetToolbarSettingsBuilder> configurator)
Parameters:configuratorAction<SpreadsheetToolbarSettingsBuilder>

The configurator for the toolbar setting.

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Toolbar(toolbar =&gt; toolbar.Home(false))
)

A Boolean value which indicates if the toolbar will be displayed.

C#
public SpreadsheetBuilder Toolbar(bool enabled)
Parameters:enabledbool

Enables or disables the toolbar option.

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Toolbar(false)
)

If set to true, the Spreadsheet formula parser will obey the decimal separator of the current culture. If set to false (default), the decimal separator in formulas will always be the dot.This flag has implications on how formulas are entered. When it is set to true, in cultures where the decimal separator is the comma (,), similar to Excel, the following additional changes upon entering a formula will occur: The semicolon will become a function argument separator. For example, =SUM(A1;A2) instead of =SUM(A1,A2). or The backslash will become an element separator in an array formula. For example, ={1\2;3\4} instead of ={1,2;3,4}.. This flag only affects the presentation - the way formulas are entered by the end user or displayed on screen. Serialization to JSON or XLSX as well as the public API functions will continue to use the dot as decimal separator and the comma as an argument separator (canonical form). For example, to apply a formula by using the API, even if useCultureDecimals is in effect, you still need to use the canonical form.

C#
public SpreadsheetBuilder UseCultureDecimals()
Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

If set to true, the Spreadsheet formula parser will obey the decimal separator of the current culture. If set to false (default), the decimal separator in formulas will always be the dot.This flag has implications on how formulas are entered. When it is set to true, in cultures where the decimal separator is the comma (,), similar to Excel, the following additional changes upon entering a formula will occur: The semicolon will become a function argument separator. For example, =SUM(A1;A2) instead of =SUM(A1,A2). or The backslash will become an element separator in an array formula. For example, ={1\2;3\4} instead of ={1,2;3,4}.. This flag only affects the presentation - the way formulas are entered by the end user or displayed on screen. Serialization to JSON or XLSX as well as the public API functions will continue to use the dot as decimal separator and the comma as an argument separator (canonical form). For example, to apply a formula by using the API, even if useCultureDecimals is in effect, you still need to use the canonical form.

C#
public SpreadsheetBuilder UseCultureDecimals(bool value)
Parameters:valuebool

The value for UseCultureDecimals

Returns:

SpreadsheetBuilder

Returns the current SpreadsheetBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.UseCultureDecimals(false)
)