New to Telerik UI for ASP.NET MVC? Download free 30-day trial

SpreadsheetSheetBuilder

Methods

ActiveCell(System.String)

The active cell in the sheet, for example, A1.

Parameters

value - System.String

The value that configures the activecell.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .ActiveCell("D4");
                        })
            )

Name(System.String)

The name of the sheet.

Parameters

value - System.String

The value that configures the name.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order");
                        })
            )

Columns(System.Action)

An array which defines the columns in this sheet and their content.

Parameters

configurator - System.Action<SpreadsheetSheetColumnFactory>

The action that configures the columns.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .Columns(columns =>
                                {
                                    columns.Add().Width(100);
                                });
                        })
            )

Drawings(System.Action)

An array which contains the drawings used in this sheet.

Parameters

configurator - System.Action<SpreadsheetSheetDrawingFactory>

The action that configures the drawings.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Images(new { testImage = "../Content/images/sample-image.png" })
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .Drawings(dr =>
                                {
                                    dr.Add()
                                    .TopLeftCell("C3")
                                    .OffsetX(30)
                                    .OffsetY(10)
                                    .Width(450)
                                    .Height(330)
                                    .Image("testImage");
                                });
                        })
            )

Filter(System.Action)

Defines the filtering criteria for this sheet, if any.

Parameters

configurator - System.Action<SpreadsheetSheetFilterSettingsBuilder>

The action that configures the filter.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .Filter(filter => filter.Columns(col => col.ValueFilter(vf => vf.Index(1))));
                        })
            )

FrozenColumns(System.Int32)

The number of frozen columns in this sheet.

Parameters

value - System.Int32

The value that configures the frozencolumns.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .FrozenColumns(2);
                        })
            )

FrozenRows(System.Int32)

The number of frozen rows in this sheet.

Parameters

value - System.Int32

The value that configures the frozenrows.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .FrozenRows(10);
                        })
            )

MergedCells(System.String[])

An array of merged cell ranges, for example, B1:D2.

Parameters

value - System.String[]

The value that configures the mergedcells.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .MergedCells("A1:G1", "C15:E15");
                        })
            )

Rows(System.Action)

The row data for this sheet.

Parameters

configurator - System.Action<SpreadsheetSheetRowFactory>

The action that configures the rows.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .Rows(rows =>
                                {
                                    rows.Add().Height(70).Cells(cells =>
                                    {
                                        cells.Add()
                                            .Value("Invoice1")
                                            .FontSize(22)
                                            .Color("lightblue");
                                    });
                                });
                        })
            )

Selection(System.String)

The selected range in the sheet, for example, A1:B10.

Parameters

value - System.String

The value that configures the selection.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .Selection("D4");
                        })
            )

ShowGridLines(System.Boolean)

A Boolean value which indicates if the grid lines of the sheet will be displayed.

Parameters

value - System.Boolean

The value that configures the showgridlines.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .ShowGridLines(false);
                        })
            )

Sort(System.Action)

Defines the sort criteria for the sheet.

Parameters

configurator - System.Action<SpreadsheetSheetSortSettingsBuilder>

The action that configures the sort.

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Food Order")
                                .Sort(sort => sort.Columns(cols => cols.Add().Ascending(true)));
                        })
            )

DataSource(System.Action)

Sets the data source configuration of the grid.

Parameters

configurator - System.Action<DataSourceBuilder>

The lambda which configures the data source

Example


             @( Html.Kendo().Spreadsheet()
                        .Name("spreadsheet")
                        .Sheets(sheets =>
                        {
                            sheets.Add()
                                .Name("Products")
                                .DataSource<SpreadsheetProductViewModel>(ds => ds
                                    .Custom()
                                    .Batch(true)
                                    .Transport(t => t
                                        .Read("onRead")
                                        .Submit("onSubmit")
                                   )
                                    .Events(e => e.Change("onChange"))
                                    .Schema(s => s
                                        .Model(m =>
                                        {
                                            m.Id(p => p.ProductID);
                                        })
                                    )
                                )
                        })
            )

In this article
Not finding the help you need?