Posted 17 July 2023, 1:23 am EST
I want the users to be able to sort the rows in a spread control, but I do not want them to be able to edit the values in the cells. I am using the asworkbook().activiesheet.protect command shown below to protect the sheet. I am using the columns(index).AllowAutoSort command to make the columns sortable. When I do not protect the worksheet, users can sort the rows by clicking on the caret in the column heading. When I protect the worksheet, users cannot sort. I am using spread version 16.0.20221.3.
fpspread1.AsWorkbook().ActiveSheet.Protect(GrapeCity.Spreadsheet.WorksheetLocks.All And
Not GrapeCity.Spreadsheet.WorksheetLocks.FormatColumns And
Not GrapeCity.Spreadsheet.WorksheetLocks.SelectUnlockedCells And
Not GrapeCity.Spreadsheet.WorksheetLocks.SelectLockedCells And
Not GrapeCity.Spreadsheet.WorksheetLocks.FormatRows)