RadSpreadsheet
ASP.NET AJAX spreadsheet control that delivers Excel-like editing, formatting, formulas, data binding and export. This partial class focuses on: creating child UI elements (toolbar, context menus, filter, custom format, validation and hyperlink dialogs), orchestrating server data binding through a pluggable SpreadsheetProviderBase implementation, serializing sheet and localization data for the client script descriptor, and handling callback persistence of a Workbook instance.
Responsibilities in this partial:
- Child control lifecycle – helper factory methods build the internal dialog containers and menus on demand.
- Data binding – tracks when data related properties change and rebinds sheets through Provider / SpreadsheetProviderBase.
- Client initialization – injects sheet data, localization and context menu IDs into the script descriptor for semantic client-side startup.
- Localization – emits culture script when a non "en-US" culture is used.
- Callback saving – implements ICallbackEventHandler so the client can persist workbook changes without full postback.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[EmbeddedSkin("Spreadsheet", typeof(RadSpreadsheet))]
[EmbeddedSkin("Spreadsheet", "Default", typeof(RadSpreadsheet))]
[RequiredCss("Telerik.Web.UI.Skins.Common.common.css", RenderMode.Lightweight, typeof(RadSpreadsheet))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadSpreadsheet))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
[RequiredScript(typeof(jQueryPlugins), 1)]
[RequiredScript(typeof(ModalExtender), 2)]
[RequiredScript(typeof(Html5Menu), 3)]
[RequiredScript(typeof(Html5Spreadsheet), 4)]
[RequiredScript(typeof(MaterialRipple))]
[ClientScriptResource("Telerik.Web.UI.RadSpreadsheet", "Telerik.Web.UI.Spreadsheet.RadSpreadsheetScripts.js", LoadOrder = 5)]
[TelerikToolboxCategory("Data")]
[ToolboxBitmap(typeof(RadSpreadsheet), "Toolbox.Icons.Spreadsheet.png")]
[CLSCompliant(false)]
public class RadSpreadsheet : RadDataBoundControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, ISpreadsheet, INamingContainer, ICallbackEventHandler
Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlRadSpreadsheet...
Implements:
Inherited Members
Constructors
public RadSpreadsheet()
Properties
[Browsable(false)]
public virtual ISpreadsheetAdapterFactory AdapterFactory { get; set; }
Gets or sets a value indicating the height of the column headers.
[ClientControlProperty]
[ClientPropertyName("columnHeaderHeight")]
public double ColumnHeaderHeight { get; set; }
Gets or sets a value indicating the number of columns.
[ClientControlProperty]
[ClientPropertyName("columnsCount")]
public int ColumnsCount { get; set; }
Gets or sets a value indicating the width of the columns.
[ClientControlProperty]
[ClientPropertyName("columnWidth")]
public double ColumnWidth { get; set; }
Gets a collection of context menus that will be shown in the Spreadsheet.
[PersistenceMode(PersistenceMode.InnerProperty)]
public SpreadsheetContextMenus ContextMenus { get; }
The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()
protected override string CssClassFormatString { get; }
Overrides:
Gets or sets the selected culture. Localization strings will be loaded based on this value.
public CultureInfo Culture { get; set; }
The culture.
Implements:
Gets the template for the custom format dialog that will be shown in the Spreadsheet.
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate CustomFormatTemplate { get; set; }
Gets the template for the filter menu that will be shown in the Spreadsheet.
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate FilterMenuTemplate { get; set; }
Gets the template for the hyperlink dialog that will be shown in the Spreadsheet.
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate HyperlinkTemplate { get; set; }
Gets the localization.
[PersistenceMode(PersistenceMode.InnerProperty)]
public SpreadsheetStrings Localization { get; }
The localization.
Implements:
Gets or sets a value indicating where RadSpreadsheet will look for its .resx localization files.
public string LocalizationPath { get; set; }
The localization path.
Gets or sets the OnClientChange.
[ClientControlEvent]
[ClientPropertyName("change")]
public string OnClientChange { get; set; }
The OnClientChange.
Gets or sets the OnClientChangeFormat.
[ClientControlEvent]
[ClientPropertyName("changeFormat")]
public string OnClientChangeFormat { get; set; }
The OnClientChangeFormat.
Gets or sets the OnClientChanging.
[ClientControlEvent]
[ClientPropertyName("changing")]
public string OnClientChanging { get; set; }
The OnClientChanging.
Gets or sets the OnClientCopy.
[ClientControlEvent]
[ClientPropertyName("copy")]
public string OnClientCopy { get; set; }
The OnClientCopy.
Gets or sets the OnClientCut.
[ClientControlEvent]
[ClientPropertyName("cut")]
public string OnClientCut { get; set; }
The OnClientCut.
Gets or sets the OnClientDeleteColumn.
[ClientControlEvent]
[ClientPropertyName("deleteColumn")]
public string OnClientDeleteColumn { get; set; }
The OnClientDeleteColumn.
Gets or sets the OnClientDeleteRow.
[ClientControlEvent]
[ClientPropertyName("deleteRow")]
public string OnClientDeleteRow { get; set; }
The OnClientDeleteRow.
Gets or sets the OnClientExcelExport.
[ClientControlEvent]
[ClientPropertyName("excelExport")]
public string OnClientExcelExport { get; set; }
The OnClientExcelExport.
Gets or sets the OnClientExcelImport.
[ClientControlEvent]
[ClientPropertyName("excelImport")]
public string OnClientExcelImport { get; set; }
The OnClientExcelImport.
Gets or sets the OnClientHideColumn.
[ClientControlEvent]
[ClientPropertyName("hideColumn")]
public string OnClientHideColumn { get; set; }
The OnClientHideColumn.
Gets or sets the OnClientHideRow.
[ClientControlEvent]
[ClientPropertyName("hideRow")]
public string OnClientHideRow { get; set; }
The OnClientHideRow.
Gets or sets the OnClientInsertColumn.
[ClientControlEvent]
[ClientPropertyName("insertColumn")]
public string OnClientInsertColumn { get; set; }
The OnClientInsertColumn.
Gets or sets the OnClientInsertRow.
[ClientControlEvent]
[ClientPropertyName("insertRow")]
public string OnClientInsertRow { get; set; }
The OnClientInsertRow.
Gets or sets the OnClientInsertSheet.
[ClientControlEvent]
[ClientPropertyName("insertSheet")]
public string OnClientInsertSheet { get; set; }
The OnClientInsertSheet.
Gets or sets the OnClientPaste.
[ClientControlEvent]
[ClientPropertyName("paste")]
public string OnClientPaste { get; set; }
The OnClientPaste.
Gets or sets the OnClientPdfExport.
[ClientControlEvent]
[ClientPropertyName("pdfExport")]
public string OnClientPdfExport { get; set; }
The OnClientPdfExport.
Gets or sets the OnClientRemoveSheet.
[ClientControlEvent]
[ClientPropertyName("removeSheet")]
public string OnClientRemoveSheet { get; set; }
The OnClientRemoveSheet.
Gets or sets the OnClientRenameSheet.
[ClientControlEvent]
[ClientPropertyName("renameSheet")]
public string OnClientRenameSheet { get; set; }
The OnClientRenameSheet.
Gets or sets the OnClientRender.
[ClientControlEvent]
[ClientPropertyName("render")]
public string OnClientRender { get; set; }
The OnClientRender.
Gets or sets the OnClientSelect.
[ClientControlEvent]
[ClientPropertyName("select")]
public string OnClientSelect { get; set; }
The OnClientSelect.
Gets or sets the OnClientSelectSheet.
[ClientControlEvent]
[ClientPropertyName("selectSheet")]
public string OnClientSelectSheet { get; set; }
The OnClientSelectSheet.
Gets or sets the OnClientUnhideColumn.
[ClientControlEvent]
[ClientPropertyName("unhideColumn")]
public string OnClientUnhideColumn { get; set; }
The OnClientUnhideColumn.
Gets or sets the OnClientUnhideRow.
[ClientControlEvent]
[ClientPropertyName("unhideRow")]
public string OnClientUnhideRow { get; set; }
The OnClientUnhideRow.
Gets or sets the provider instance to be used by Spreadsheet. Use this property with providers that are created at runtime. For ASP.NET providers defined in web.config use the ProviderName property.
[Browsable(false)]
public SpreadsheetProviderBase Provider { get; set; }
The provider instance to be used by Spreadsheet.
Gets or sets the name of the current tasks provider used by Spreadsheet. The provider must be defined in the Spreadsheet section of web.config.
[PersistenceMode(PersistenceMode.Attribute)]
public string ProviderName { get; set; }
The name of the current tasks provider used by Spreadsheet as defined in web.config.
Gets the resolved render mode.
public override RenderMode ResolvedRenderMode { get; }
The resolved render mode.
Overrides:
Implements:
Gets the real skin name for the control user interface. If Skin is not set, returns "Default", otherwise returns Skin.
public string ResolvedSkin { get; }
Implements:
Gets or sets a value indicating the width of the row headers.
[ClientControlProperty]
[ClientPropertyName("rowHeaderWidth")]
public double RowHeaderWidth { get; set; }
Gets or sets a value indicating the height of the rows.
[ClientControlProperty]
[ClientPropertyName("rowHeight")]
public double RowHeight { get; set; }
Gets or sets a value indicating the number of rows.
[ClientControlProperty]
[ClientPropertyName("rowsCount")]
public int RowsCount { get; set; }
protected JavaScriptSerializer Serializer { get; }
[Browsable(false)]
public virtual List<Worksheet> Sheets { get; }
Implements:
protected override bool SupportsRenderingMode { get; }
Overrides:
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets a toolbar with a collection of tools that will be shown in the Spreadsheet.
[PersistenceMode(PersistenceMode.InnerProperty)]
public SpreadsheetToolbar Toolbar { get; }
Gets the template for the validation dialog that will be shown in the Spreadsheet.
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate ValidationTemplate { get; set; }
Methods
protected override void CreateChildControls()
Overrides:
protected virtual void CreateContextMenus()
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
protected override void EnsureDataBound()
Overrides:
Returns a fixed OK string to acknowledge a completed callback. Client scripts can use this to verify success.
protected virtual void LoadAdapterFactory()
protected virtual void LoadProvider()
protected override void OnDataPropertyChanged()
Overrides:
protected override void PerformSelect()
Overrides: