wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-7714b885.md
Occurs when attempting to edit a locked cell in a protected worksheet.
Namespace : DevExpress.Xpf.Spreadsheet
Assembly : DevExpress.Xpf.Spreadsheet.v25.2.dll
NuGet Package : DevExpress.Wpf.Spreadsheet
public event HandledEventHandler ProtectionWarning
Public Event ProtectionWarning As HandledEventHandler
The ProtectionWarning event's data class is HandledEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Handled | Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. |
If you want to customize the warning dialog which appears each time a user attempts to modify a locked cell, handle the ProtectionWarning event. To suppress the default warning dialog, set the e.Handled property to true. Invoke your own dialog within the event handler.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ProtectionWarning event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-spreadsheet-control-create-a-data-entry-form/CS/WpfDataEntryFormSample/MainWindow.xaml#L29
CustomCellEdit="SpreadsheetControl1_CustomCellEdit"
ProtectionWarning="SpreadsheetControl1_ProtectionWarning"
SelectionChanged="SpreadsheetControl1_SelectionChanged">
#line 29 "..\..\..\MainWindow.xaml"
this.spreadsheetControl1.ProtectionWarning += new System.ComponentModel.HandledEventHandler(this.SpreadsheetControl1_ProtectionWarning);
#ExternalSource("..\..\..\MainWindow.xaml",29)
AddHandler Me.spreadsheetControl1.ProtectionWarning, New System.ComponentModel.HandledEventHandler(AddressOf Me.SpreadsheetControl1_ProtectionWarning)
See Also