Articles in this section
Category / Section

How to make a cell/row/column non-editable without protecting the worksheet?

1 min read

SfSpreadsheet allows you to disable the editing of any cell, row and column without protecting the worksheet by Cancel the CurrentCellBeginEdit event of SpreadsheetGrid.

 

C#

Spreadsheet.ActiveGrid.CurrentCellBeginEdit += ActiveGrid_CurrentCellBeginEdit;
void ActiveGrid_CurrentCellBeginEdit(object sender, CurrentCellBeginEditEventArgs args)
{
    if (args.RowcolumnIndex.RowIndex == 5 && args.RowcolumnIndex.ColumnIndex == 5)
        args.Cancel = true;
}
 

 

Sample links:

 

WPF

 

WinRT

 

WinForms

 

UWP


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied