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.
- C#
- VB.NET
public class kendoSpreadsheet : kendoBase
Public Class kendoSpreadsheet
Inherits kendoBase
Constructors
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);
kendoSpreadsheet(options)
Constructs a new instance of the kendoSpreadsheet class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial 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
FromFile(stream)
Clears the spreadsheet and populates it with data from the specified Excel (.xlsx) file.
| Parameter | Type | Description |
|---|---|---|
| stream | MemoryStream | A 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);
}
}
OnWebRequest(e)
Processes requests from the client.
| Parameter | Type | Description |
|---|---|---|
| e | WebRequestEventArgs |