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


    <img src="/emoticons/emotion-2.gif" alt="Big Smile" />


    <img src="/emoticons/emotion-2.gif" alt="Big Smile" />


    <img src="/emoticons/emotion-2.gif" alt="Big Smile" />


    <img src="/emoticons/emotion-2.gif" alt="Big Smile" />


    <img src="/emoticons/emotion-2.gif" alt="Big Smile" />


    <img src="/emoticons/emotion-2.gif" alt="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.

    <FONT size=2>

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


    FpSpread1.Enabled = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT>
  • Replied 8 September 2017, 1:44 pm EST

    <H4 style="MARGIN-BOTTOM:5px;">thanks for your answer,but ......it can't work when the <U> </U>Spread is not enabled </H4>
    <H4 style="MARGIN-BOTTOM:5px;"><U>SPREAD for .NET 3.0J Windows Forms Edition ???????</U></H4>

    <B>Version 3.0.2009.2005</B><FONT color=#000000> </FONT>



    <TABLE class="" cellSpacing=0>

    <TR>
    <TD class="">FarPoint.Win.SpreadJ.dll</TD>
    <TD class="">???????
    Assembly version: 3.0.2009.2005
    ?????????: 3.0.2009.2005</TD></TR>
    <TR>
    <TD class="">FarPoint.Win.dll</TD>
    <TD class="">???????
    Assembly version: 3.0.2009.2005
    ?????????: 3.0.2009.2005</TD></TR></TABLE>


    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.

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> Form1_Load(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.Object, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.EventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>MyBase</FONT></FONT><FONT size=2>.Load


    FpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).Renderer = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> myRedCell


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


    FpSpread1.Enabled = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Public</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Class</FONT></FONT><FONT size=2> myRedCell


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Inherits</FONT></FONT><FONT size=2> FarPoint.Win.Spread.CellType.ColumnHeaderRenderer


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Public</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Overrides</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> PaintCell(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> g </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.Drawing.Graphics, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> r </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.Drawing.Rectangle, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> appearance </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> FarPoint.Win.Spread.Appearance, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> value </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Object</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> isSelected </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Boolean</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> isLocked </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Boolean</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> zoomFactor </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Single</FONT></FONT><FONT size=2>)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> isLocked </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then</FONT></FONT><FONT size=2> isLocked = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    appearance.VisualStyles = FarPoint.Win.VisualStyles.Off


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>MyBase</FONT></FONT><FONT size=2>.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub


    End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Class

    </FONT></FONT>
  • Replied 8 September 2017, 1:44 pm EST

    thank you very much


    ????


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


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


    <img src="/emoticons/emotion-21.gif" alt="Yes" /><img src="/emoticons/emotion-49.gif" alt="Cake" />

Need extra support?

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

Learn More

Forum Channels