Partial class containing AI-related functionality for the RadSpreadsheetElement.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadSpreadsheet.dll
Syntax:
public class RadSpreadsheetElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, ICommandDescriptorsProvider, IScrollBarsProvider, IWeakEventListener
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementRadSpreadsheetElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadSpreadsheetElement class with default settings and components. Sets up the input handler, sheet selector, status bar, themes, and worksheet editor components.
public RadSpreadsheetElement()
Fields
Identifies the ActiveSheetEditor dependency property.
public static readonly RadProperty ActiveSheetEditorProperty
Identifies the AIToolsProvider property.
public static readonly RadProperty AIToolsProviderProperty
Identifies the CommandDescriptors dependency property.
public static readonly RadProperty CommandDescriptorsProperty
Identifies the FillHandleSelectionStroke dependency property.
public static readonly RadProperty FillHandleSelectionStrokeProperty
Identifies the FormulaBarHeight dependency property.
public static readonly RadProperty FormulaBarHeightProperty
Identifies the IsAIEnabled property.
public static readonly RadProperty IsAIEnabledProperty
Identifies the IsAIPanelVisible property.
public static readonly RadProperty IsAIPanelVisibleProperty
Identifies the SelectionFill dependency property.
public static readonly RadProperty SelectionFillProperty
Identifies the SelectionStroke dependency property.
public static readonly RadProperty SelectionStrokeProperty
Identifies the SelectionStrokeThickness dependency property.
public static readonly RadProperty SelectionStrokeThicknessProperty
Identifies the StatusBarHeight dependency property.
public static readonly RadProperty StatusBarHeightProperty
Identifies the Workbook dependency property.
public static readonly RadProperty WorkbookProperty
Identifies the WorksheetEditorContextMenu dependency property.
public static readonly RadProperty WorksheetEditorContextMenuProperty
Properties
Gets or sets the currently active sheet within the workbook.
public Sheet ActiveSheet { get; set; }
Gets the currently active sheet editor that provides editing functionality for the current sheet.
public IRadSheetEditor ActiveSheetEditor { get; }
Gets or sets the currently active worksheet, providing typed access to worksheet-specific functionality.
public Worksheet ActiveWorksheet { get; set; }
Gets or sets the active worksheet editor that provides editing capabilities for the current worksheet.
public RadWorksheetEditor ActiveWorksheetEditor { get; set; }
Gets the AI panel element, or null if the panel has not been initialized yet.
public SpreadsheetAIPanelElement AIPanelElement { get; }
Gets or sets the AI tools provider.
[CLSCompliant(false)]
public AIToolsProvider AIToolsProvider { get; set; }
Gets or sets the color palette used for cell formatting and theming operations.
public SpreadsheetColorPalette ColorPalette { get; set; }
Gets the collection of command descriptors available for spreadsheet operations.
public CommandDescriptors CommandDescriptors { get; }
Implements:
Gets or sets the brush used to draw the fill handle selection indicator.
public Brush FillHandleSelectionStroke { get; set; }
Gets the fonts provider that manages font information and font families for the spreadsheet.
public FontsProvider FontsProvider { get; }
Gets the formula bar element that allows editing of cell formulas and values.
public RadSpreadsheetFormulaBar FormulaBar { get; }
Gets or sets the height of the formula bar in pixels.
public int FormulaBarHeight { get; set; }
Gets the horizontal scroll bar element for navigating the worksheet horizontally.
public RadScrollBarElement HorizontalScrollBar { get; }
Implements:
Gets or sets the input behavior handler that manages keyboard and mouse interactions for the spreadsheet.
public SpreadsheetInputBehavior InputHandler { get; set; }
Gets or sets a value indicating whether AI features are enabled.
public bool IsAIEnabled { get; set; }
Gets or sets a value indicating whether the AI panel is visible.
public bool IsAIPanelVisible { get; set; }
Gets the print manager that provides printing functionality for the spreadsheet content.
public PrintManager PrintManager { get; }
Gets or sets the brush used to fill the background of selected cells and ranges.
public Brush SelectionFill { get; set; }
Gets or sets the brush used to draw the outline of selected cells and ranges.
public Brush SelectionStroke { get; set; }
Gets or sets the thickness of the stroke used to outline selected cells and ranges.
public double SelectionStrokeThickness { get; set; }
Gets the sheet selector element that displays worksheet tabs and allows sheet navigation.
public RadSpreadsheetSheetSelector SheetSelector { get; }
Gets or sets the context menu displayed when right-clicking on worksheet tabs in the sheet selector.
public RadContextMenu SheetSelectorContextMenu { get; set; }
Gets the status bar element that displays information about the current selection and spreadsheet state.
public RadSpreadsheetStatusBar StatusBar { get; }
Gets or sets the height of the status bar in pixels.
public int StatusBarHeight { get; set; }
Gets or sets the document theme that defines colors, fonts, and effects for the spreadsheet.
public DocumentTheme Theme { get; set; }
Gets the themes manager that handles document theme operations and theme switching.
public RadSpreadsheetThemesManager ThemesManager { get; }
Gets the vertical scroll bar element for navigating the worksheet vertically.
public RadScrollBarElement VerticalScrollBar { get; }
Implements:
Gets or sets the dimensions of the visible worksheet area in rows and columns.
public SizeI VisibleSize { get; set; }
Gets or sets the workbook that contains all worksheets and spreadsheet data.
public Workbook Workbook { get; set; }
Gets or sets the context menu displayed when right-clicking within the worksheet editor area.
public RadContextMenu WorksheetEditorContextMenu { get; set; }
Gets or sets the builder responsible for creating and managing worksheet UI layers.
public WorksheetUILayersBuilder WorksheetUILayersBuilder { get; set; }
Methods
Arranges the spreadsheet element and positions all child components within the final layout area.
Begins an undo group that allows multiple operations to be undone as a single action. Use in conjunction with EndUndoGroup() to group related operations.
public void BeginUndoGroup()
Cancels the currently active undo group, discarding all operations that would have been grouped since the last call to BeginUndoGroup().
public void CancelUndoGroup()
Creates the child elements that make up the spreadsheet's visual structure. Initializes the formula bar, content presenter, scroll bars, sheet selector, and other UI components.
protected override void CreateChildElements()
Overrides:
Releases managed resources used by the AI functionality.
protected override void DisposeManagedResources()
Overrides:
Updates the element and its children to account for DPI scaling changes. Ensures that the spreadsheet and its components render correctly at different DPI settings.
public override void DpiScaleChanged(SizeF scaleFactor)
The new DPI scale factor to apply.
Overrides:
Ends the currently active undo group, finalizing the grouping of operations since the last call to BeginUndoGroup().
public void EndUndoGroup()
Ensures the AI panel content is created and configured.
public void EnsureAIPanelContent()
protected virtual void EnsureDefaultContextMenu()
Hides the AI panel.
public void HideAIPanel()
Invalidates the layout.
public void InvalidateLayout()
Raises the ActiveSheetChanged event.
protected virtual void OnActiveSheetChanged()
Raises the ActiveSheetEditorChanged event.
protected virtual void OnActiveSheetEditorChanged()
Raises the BeforeOpenFile event.
protected virtual void OnBeforeOpenFile(OpenFileDialogEventArgs args)
Event arguments that hold the event data.
Raises the BeforeSaveFile event.
protected virtual void OnBeforeSaveFile(SaveFileDialogEventArgs args)
Event arguments that hold the event data.
Raises the ContextMenuShowing event.
protected virtual void OnContextMenuShowing(object sender, SpreadsheetContextMenuOpeningEventArgs e)
The object that initiated the event.
eSpreadsheetContextMenuOpeningEventArgsEvent arguments containing context menu information.
Raises the MessageShowing event.
protected virtual void OnMessageShowing(MessageShowingEventArgs args)
The event arguments containing message information.
Raises the MouseDown event and handles right-click actions to show the context menu.
protected override void OnMouseDown(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Called when a RadProperty value changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Overrides:
Called when the template is applying.
protected virtual void OnTemplateApplying()
Raises the WorkbookChanged event.
protected virtual void OnWorkbookChanged()
Raises the WorkbookChanging event.
protected virtual void OnWorkbookChanging()
Raises the WorkbookCommandError event.
protected virtual void OnWorkbookCommandError(CommandErrorEventArgs args)
The event arguments containing error information.
Raises the WorkbookCommandExecuted event.
protected virtual void OnWorkbookCommandExecuted(CommandExecutedEventArgs args)
The event arguments containing command execution results.
Raises the WorkbookCommandExecuting event.
protected virtual void OnWorkbookCommandExecuting(CommandExecutingEventArgs args)
The event arguments containing command execution details.
Prints the spreadsheet content using the specified print settings. Allows printing the active worksheet, a specific range of cells, or the entire workbook.
public void Print(PrintWhatSettings printWhatSettings, string printDescription = null, bool showDialog = true)
Settings that determine what content should be printed (worksheet, selection, etc.).
printDescriptionstringOptional description text that appears in the print preview and printed output.
showDialogboolWhen true, displays the print dialog before printing; when false, prints directly with current settings.
Shows the print preview dialog that allows the user to view how the spreadsheet will look when printed and make adjustments to print settings before printing.
public void PrintPreview()
Processes the MouseWheel event for zooming and scrolling the spreadsheet. When Control key is pressed, zooms in or out; otherwise scrolls the worksheet vertically.
public virtual bool ProcessMouseWheel(MouseEventArgs e, bool control)
The event arguments containing mouse wheel delta information.
controlboolTrue if Control key was pressed, false otherwise.
Returns:True if the event was handled and should not be processed further, false otherwise.
Receives events from the centralized event manager.
public bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
The type of the WeakEventManager calling this method.
senderobjectObject that originated the event.
eEventArgsEvent data.
Returns:true if the listener handled the event. It is considered an error by the WeakEventManager handling in WPF to register a listener for an event that the listener does not handle. Regardless, the method should return false if it receives an event that it does not recognize or handle.
Implements:
Redoes the most recently undone operation or group of operations in the spreadsheet.
protected virtual void SetDarkIcons()
Sets the horizontal scroll position of the active sheet editor. Controls the horizontal scrolling position of the worksheet viewport.
public void SetHorizontalOffset(double offset)
The horizontal offset value to set in pixels.
protected virtual void SetStandardIcons()
Sets the vertical scroll position of the active sheet editor. Controls the vertical scrolling position of the worksheet viewport.
public void SetVerticalOffset(double offset)
The vertical offset value to set in pixels.
Shows the AI panel.
public void ShowAIPanel()
Toggles the visibility of the AI panel.
public void ToggleAIPanel()
Undoes the most recent operation or group of operations in the spreadsheet.
Updates the icon set used throughout the spreadsheet interface to match the current theme. Ensures proper icon contrast when switching between light and dark themes.
public virtual void UpdateIconSet()
Events
Occurs when the active sheet changes to a different worksheet within the workbook.
public event EventHandler ActiveSheetChanged
Occurs when the active sheet editor changes to a different editor implementation.
public event EventHandler ActiveSheetEditorChanged
Occurs before a file is opened, before the open file dialog is shown.
public event EventHandler<OpenFileDialogEventArgs> BeforeOpenFile
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.
Occurs before the file is saved, before the save file dialog is shown.
public event EventHandler<SaveFileDialogEventArgs> BeforeSaveFile
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.
Occurs when the spreadsheet context menu is about to be shown. Allows customization of the context menu items before they are displayed.
public event SpreadsheetContextMenuOpeningEventHandler ContextMenuShowing
Occurs when a message or warning needs to be displayed to the user.
public event EventHandler<MessageShowingEventArgs> MessageShowing
Occurs after the workbook has been changed to a different workbook instance.
public event EventHandler WorkbookChanged
Occurs before the workbook is changed, allowing for preparation or validation before the change.
public event EventHandler WorkbookChanging
Occurs when an error occurs during the execution of a workbook command.
public event EventHandler<CommandErrorEventArgs> WorkbookCommandError
Occurs after a workbook command has been successfully executed.
public event EventHandler<CommandExecutedEventArgs> WorkbookCommandExecuted
Occurs before a workbook command is executed, allowing for cancellation or modification of the command.
public event EventHandler<CommandExecutingEventArgs> WorkbookCommandExecuting
Occurs when any content within the workbook has been modified, such as cell values, formatting, or structure changes.
public event EventHandler WorkbookContentChanged