can you change the BackColor property of the RowHeader or the ColumnHearder,when the FpSpread's enabled property is false

Posted by: herotiger on 8 September 2017, 1:44 pm EST

  • Posted 8 September 2017, 1:44 pm EST

    I want to change the backcolor of the spread,when it is disabled.


    I can change cell's backcolor,but I can't change the backcolor of the rowheader and the columnheader


    can you tell me how to change it?

  • Replied 8 September 2017, 1:44 pm EST

    thanks very much,everybody


    Big Smile


    Big Smile


    Big Smile


    Big Smile


    Big Smile


    Big Smile


    help me ,please

  • Replied 8 September 2017, 1:44 pm EST

    Hello,


    Make sure you have the latest maintenance release, since I believe this was a bug in the earlier release. However, with the latest release, you can change the BackColor of any cell whether the Spread is enabled or not.


    FpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).BackColor = Color.Red


    FpSpread1.Enabled = False

  • Replied 8 September 2017, 1:44 pm EST

    thanks for your answer,but ......it can't work when the  Spread is not enabled


    SPREAD for .NET 3.0J Windows Forms Edition ???????


    Version 3.0.2009.2005










    FarPoint.Win.SpreadJ.dll???????
    Assembly version: 3.0.2009.2005
    ?????????: 3.0.2009.2005
    FarPoint.Win.dll???????
    Assembly version: 3.0.2009.2005
    ?????????: 3.0.2009.2005


    I only have this version's license


    can you tell me,where can I find the bug report of this bug

  • Replied 8 September 2017, 1:44 pm EST

    Hello,


    Version 3 of the product did not have a way to do this with code like I had. You would need to paint the cell yourself using a custom renderer and overriding the PaintCell method.


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


    FpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).Renderer = New myRedCell


    FpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).BackColor = Color.Red


    FpSpread1.Enabled = False


    End Sub


    Public Class myRedCell


    Inherits FarPoint.Win.Spread.CellType.ColumnHeaderRenderer


    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)


    If isLocked Then isLocked = False


    appearance.VisualStyles = FarPoint.Win.VisualStyles.Off


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


    End Sub


    End Class

  • Replied 8 September 2017, 1:44 pm EST

    thank you very much


    ????


    ???????????????


    ??????????????


    YesCake

Need extra support?

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

Learn More

Forum Channels