FlatRowHeaderRenderer appearance.cellPadding is incorrect

Posted by: kbj on 4 February 2018, 10:58 am EST

    • Post Options:
    • Link

    Posted 4 February 2018, 10:58 am EST

    The PaintCell appearance.cellpadding value shows a cellpadding(0) value even if the header cell being painted has a different cellpadding value as illustrated below. Cell padding values can be added to the appearance during the paint and process correctly, but why not just have them show up in passed appearance.cellpadding the first place?

    Imports FarPoint.Win.Spread

    Imports FarPoint.Win.Spread.CellType

    Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

    FpSpread1.ActiveSheet.RowHeaderAutoText = HeaderAutoText.Blank

    FpSpread1.ActiveSheet.RowHeader.DefaultStyle.CellPadding = New CellPadding(7)

    FpSpread1.ActiveSheet.RowHeader.Cells(0, 0).Renderer = New rhr

    FpSpread1.ActiveSheet.RowHeader.Cells(0, 0).CellPadding = New CellPadding(10)

    FpSpread1.ActiveSheet.RowHeader.Cells(0, 0).Value = “X”

    FpSpread1.ActiveSheet.Cells(0, 0).CellType = New nct

    FpSpread1.ActiveSheet.Cells(0, 0).CellPadding = New CellPadding(5)

    FpSpread1.ActiveSheet.Cells(0, 0).Value = 123

    End Sub

    End Class

    Public Class rhr

    Inherits FlatRowHeaderRenderer

    Public Overrides Sub PaintCell(g As Graphics,

    r As Rectangle,

    appearance As Appearance,

    value As Object,

    isSelected As Boolean,

    isLocked As Boolean,

    zoomFactor As Single)

    appearance.VerticalAlignment = CellVerticalAlignment.Bottom

    Debug.Print(getCellpaddingString(appearance.CellPadding))

    MyBase.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor)

    End Sub

    Private Function getCellpaddingString(cp As CellPadding)

    Return (“Left:” & cp.Left.ToString & " Top:" & cp.Top.ToString & " Right:" & cp.Right.ToString & " Bottom:" & cp.Bottom.ToString)

    End Function

    End Class

    Public Class nct

    Inherits NumberCellType

    Public Overrides Sub PaintCell(g As Graphics,

    r As Rectangle,

    appearance As Appearance,

    value As Object,

    isSelected As Boolean,

    isLocked As Boolean,

    zoomFactor As Single)

    Debug.Print(getCellpaddingString(appearance.CellPadding))

    MyBase.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor)

    End Sub

    Private Function getCellpaddingString(cp As CellPadding)

    Return (“Left:” & cp.Left.ToString & " Top:" & cp.Top.ToString & " Right:" & cp.Right.ToString & " Bottom:" & cp.Bottom.ToString)

    End Function

    End Class

  • Posted 5 February 2018, 5:00 am EST

    Hello,

    CellPadding does not work on non-editable cell types such as the Row Headers. You need to explicitly add the value of CellPadding to the appearance during the paint.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels