Mouseover of cell with inherited celltype causes value to revert

Posted by: tthogan3 on 8 September 2017, 2:01 pm EST

  • Posted 8 September 2017, 2:01 pm EST

    I have a child class MyDecimalCellType that inherits from FarPoint.Win.Spread.CellType.NumberCellType.  If I am editing a cell with cell type MyDecimalCellType, then move the mouse cursor over the cell, the value reverts to the previous value before editing started.  How do I avoid the reversion?

  • Replied 8 September 2017, 2:01 pm EST

    Hello,

    I have tested this issue at my side with 4.0.2010.2005 version of Spread, but could not replicate the said issue.I have used the below snippet:

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            FpSpread1.ActiveSheet.Columns(1).CellType = New MyDecimalCellType

    End Sub

    Public Class MyDecimalCellType
            Inherits FarPoint.Win.Spread.CellType.NumberCellType
            Public Overrides Sub PaintCell(ByVal g As System.Drawing.Graphics, ByVal r As System.Drawing.Rectangle, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal value As Object, ByVal isSelected As Boolean, ByVal isLocked As Boolean, ByVal zoomFactor As Single)
                Dim backBrush As New SolidBrush(appearance.BackColor)
                Dim foreBrush As New SolidBrush(appearance.ForeColor)
                Dim rf As New RectangleF(r.X, r.Y, r.Width, r.Height)
                g.FillRectangle(backBrush, r)
                If IsNumeric(value) Then
                    value &= " .00"
                    g.DrawString(value, appearance.Font, foreBrush, rf)
                End If
                backBrush.Dispose()
                foreBrush.Dispose()
    End Sub

    End Class

    If I edit any value in column1 and hover the mouse over it, the value is not reverting back to original value. Could you please send a small zipped project for us to debug?Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels