ClassRadSpreadsheet
Represents a comprehensive spreadsheet control that provides Excel-like functionality for viewing, editing, and manipulating workbook data with support for multiple worksheets, formulas, formatting, and data operations. This control serves as the main container for spreadsheet functionality and can be seamlessly integrated with a RadSpreadsheetRibbonBar to provide a complete ribbon-based user interface with comprehensive editing commands, formatting options, and spreadsheet operations.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadSpreadsheet.dll
Syntax:
[TelerikToolboxCategory("Spreadsheet")]
[Docking(DockingBehavior.Ask)]
public class RadSpreadsheet : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IPrintable
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadSpreadsheet
Implements:
Inherited Members
Constructors
RadSpreadsheet()
Declaration
public RadSpreadsheet()
Fields
Properties
ActiveSheet
Gets or sets the currently active sheet in the spreadsheet workbook.
ActiveWorksheet
Gets or sets the currently active worksheet in the spreadsheet, which is the worksheet that is currently displayed and available for editing.
Declaration
public Worksheet ActiveWorksheet { get; set; }
Property Value
ActiveWorksheetEditor
Gets or sets the editor for the currently active worksheet, providing access to editing operations on the worksheet content.
Declaration
public RadWorksheetEditor ActiveWorksheetEditor { get; set; }
Property Value
DefaultSize
Gets the default size of the spreadsheet control.
Declaration
protected override Size DefaultSize { get; }
Property Value
A Size value representing the default dimensions of the control.
Overrides
Dispatcher
Gets the dispatcher for this spreadsheet control, which allows scheduling of operations that need to be executed on the UI thread.
InputHandler
Gets or sets an instance of SpreadsheetInputBehavior that handles all user input including keyboard navigation, selection, and cell editing operations.
Declaration
[Browsable(false)]
public SpreadsheetInputBehavior InputHandler { get; set; }
Property Value
SpreadsheetElement
Gets the RadSpreadsheetElement of this control, which contains the core UI components and functionality of the spreadsheet.
Declaration
public RadSpreadsheetElement SpreadsheetElement { get; }
Property Value
Methods
BeginUndoGroup()
Begins an undo group that allows multiple operations to be undone as a single action. Use in conjunction with EndUndoGroup() to group related operations.
Declaration
public void BeginUndoGroup()
CancelUndoGroup()
Cancels the currently active undo group, discarding all operations that would have been grouped since the last call to BeginUndoGroup().
Declaration
public void CancelUndoGroup()
CreateBehavior()
Creates the input behavior component for the RadSpreadsheet control.
Declaration
protected override ComponentInputBehavior CreateBehavior()
Returns
A new instance of RadSpreadsheetComponentInputBehavior configured for this spreadsheet.
Overrides
CreateChildItems(RadElement)
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
Overrides
CreateSpreadsheetElement()
Declaration
protected virtual RadSpreadsheetElement CreateSpreadsheetElement()
Returns
EndUndoGroup()
Ends the currently active undo group, finalizing the grouping of operations since the last call to BeginUndoGroup().
Declaration
public void EndUndoGroup()
IsInputKey(Keys)
Determines whether the specified key is an input key that the spreadsheet should process, rather than a key that the form should process.
OnKeyDown(KeyEventArgs)
Raises the KeyDown event and processes keyboard input for the spreadsheet control.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
A KeyEventArgs that contains the event data.
Overrides
OnKeyPress(KeyPressEventArgs)
Raises the KeyPress event and processes character input for the spreadsheet control.
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
e
A KeyPressEventArgs that contains the event data.
Overrides
OnKeyUp(KeyEventArgs)
Raises the KeyUp event and processes the key release event for the spreadsheet control.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
e
A KeyEventArgs that contains the event data.
Overrides
OnMouseWheel(MouseEventArgs)
Raises the MouseWheel event and processes mouse wheel scrolling for the spreadsheet control.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
A MouseEventArgs that contains the event data.
Overrides
OnThemeChanged()
Raises the ThemeChanged event and updates visual elements to reflect the new theme.
Declaration
protected override void OnThemeChanged()
Overrides
Print(PrintWhatSettings, string, bool)
Prints the spreadsheet content using the specified print settings and optional description.
Declaration
public void Print(PrintWhatSettings printSettings, string printDescription = null, bool showDialog = true)
Parameters
printSettings
The settings that determine what content should be printed, such as specific worksheets or selection.
printDescription
Optional description text that appears in the print preview and printed output.
showDialog
When true, displays the print dialog before printing; when false, prints directly with current settings.
PrintPreview()
Shows a print preview dialog that allows the user to view how the spreadsheet will look when printed and make adjustments to print settings before printing.
Declaration
public void PrintPreview()
ProcessDialogChar(char)
Processes a dialog character, which is a character that is processed by the active form's dialog box. Overridden to handle character input with modifier keys for the spreadsheet.
ProcessDialogKey(Keys)
Processes a dialog key, which is a key that is processed by the active form's dialog box. Overridden to handle Enter key specially for the spreadsheet.
ProcessMnemonic(char)
Processes a mnemonic character, which is a character used to select menu items or controls by keyboard. Overridden to customize mnemonic handling for the spreadsheet.
Redo()
Redoes the most recently undone operation or group of operations in the spreadsheet.
Declaration
public bool Redo()
Returns
True if the redo operation succeeded; otherwise, false.
Events
BeforeOpenFile
Occurs before a file is opened, before the open file dialog is shown.
Declaration
public event EventHandler<OpenFileDialogEventArgs> BeforeOpenFile
Event Value
Remarks
Subscribe to this event to customize the OpenFileDialog properties (like Filter, InitialDirectory, etc.) before it is displayed to the user. Handlers can also cancel the open file operation by setting the Cancel property of the event arguments to true.
BeforeSaveFile
Occurs before the file is saved, before the save file dialog is shown.
Declaration
public event EventHandler<SaveFileDialogEventArgs> BeforeSaveFile
Event Value
Remarks
Subscribe to this event to customize the SaveFileDialog properties (like Filter, InitialDirectory, etc.) before it is displayed to the user. Handlers can also cancel the open file operation by setting the Cancel property of the event arguments to true.