Posted 12 February 2018, 2:29 am EST
With a sheet.Models.Data inherited form the DefaultSheetDataModel, if you drag a locked row, the cell locking in that row gets messed up. In this example:
Imports FarPoint.Win.Spread
Imports FarPoint.Win.Spread.Model
Public Class Form1
Private WithEvents wb As FpSpread
Private WithEvents ws As SheetView
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
wb = New FpSpread
wb.AllowRowMove = True
ws = New SheetView
ws.Models.Data = New myDataSheetDataModel 'comment out this line and example works
ws.RowCount = 5
ws.ColumnCount = 3
ws.Cells(0, 0, 4, 2).LockBackColor = Color.PaleGoldenrod
ws.Cells(2, 0, 2, 2).Locked = True
ws.Cells(2, 0, 2, 2).Value = “Locked”
ws.OperationMode = OperationMode.SingleSelect
wb.Sheets.Add(ws)
Controls.Add(wb)
wb.Dock = DockStyle.Fill
End Sub
Private Sub RowDragMoveCompleted(sender As Object, e As DragMoveCompletedEventArgs) Handles wb.RowDragMoveCompleted
For rowIndex = 0 To ws.RowCount - 1
Debug.Print(rowIndex.ToString & “:” & ws.Cells(rowIndex, 0).Locked.ToString)
Next
End Sub
End Class
Public Class myDataSheetDataModel
Inherits DefaultSheetDataModel
End Class
row 3 the locked row is dragged to row 4
and the locking is wrong.