Skip to main content

kendoSpreadsheet

Namespace: Wisej.Web.Ext.Kendo

Assembly: Wisej.Web.Ext.Kendo (4.1.0.0)

The Spreadsheet allows you to edit and visualize tabular data by using cell formatting options, styles, and themes.

public class kendoSpreadsheet : kendoBase

Constructors​

Instance member kendoSpreadsheet()​

Constructs a new instance of the kendoSpreadsheet class.

Example:

The following example creates a spreadsheet and hides its toolbar and sheets bar through the Options property.

var spreadsheet = new kendoSpreadsheet();
spreadsheet.Options.toolbar = false;
spreadsheet.Options.sheetsbar = false;
spreadsheet.Dock = DockStyle.Fill;
this.Controls.Add(spreadsheet);

Instance member kendoSpreadsheet(options)​

Constructs a new instance of the kendoSpreadsheet class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example creates a spreadsheet with one sheet and some initial cells.

var spreadsheet = new kendoSpreadsheet(new
{
sheets = new[]
{
new
{
name = "Budget",
rows = new[]
{
new { cells = new object[] { new { value = "Item", bold = true }, new { value = "Amount", bold = true } } },
new { cells = new object[] { new { value = "Rent" }, new { value = 1200 } } },
new { cells = new object[] { new { value = "Utilities" }, new { value = 180 } } }
}
}
}
});
spreadsheet.Dock = DockStyle.Fill;
this.Controls.Add(spreadsheet);

Methods​

Instance member FromFile(stream)​

Clears the spreadsheet and populates it with data from the specified Excel (.xlsx) file.

ParameterTypeDescription
streamMemoryStreamA MemoryStream containing the Excel (.xlsx) file to load.

The whole content of stream is copied, regardless of its current position, and the widget downloads it from the server and loads it with the Kendo fromFile method. The copy is released once the browser has downloaded it.

Example:

The following example loads an Excel file uploaded by the user.

private void upload1_Uploaded(object sender, UploadedEventArgs e)
{
var file = e.Files[0];
using (var stream = new MemoryStream())
{
file.InputStream.CopyTo(stream);
this.kendoSpreadsheet1.FromFile(stream);
}
}

Protected member OnWebRequest(e)​

Processes requests from the client.

ParameterTypeDescription
eWebRequestEventArgs

Implements​