can I specify "+" sign on which column in multi columns for rowheader

Posted by: min-fp on 8 September 2017, 2:14 pm EST

  • Posted 8 September 2017, 2:14 pm EST

    It seems "+" sign is always together with the autoindex column, can I have two columns for rowheader. first column is autoindex, second column only has the "+" sign?


  • Replied 8 September 2017, 2:14 pm EST


    I don't find an easy way to do that. Please have a look at the below code to manually set the auto Index, but that makes the "+" sign visible on the second column.

            FpSpread1.ActiveSheet.RowHeader.ColumnCount = 2
            FpSpread1.ActiveSheet.RowHeaderAutoText = FarPoint.Win.Spread.HeaderAutoText.Blank
            For i As Integer = 0 To 2
                FpSpread1.ActiveSheet.RowHeader.Cells(i, 0).Text = i + 1
            Next i

    I hope it will help you.





  • Replied 8 September 2017, 2:14 pm EST

    Thanks for you reply, but that is not good enough. There are rows being added and deleted in the program. the manual count won't work.
  • Replied 8 September 2017, 2:14 pm EST


    The other way would be to use "+" image(<span class="Apple-style-span" style="border-collapse:separate;font-family:Tahoma;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;"><span class="Apple-style-span" style="font-size:12px;text-align:left;"></span></span>) & "-"(FarPoint.Win.Spread.minus.gif) in the Row header cell on header click check and setting the Heder auto text.You may set spreas's expandRow method to true on "+" click and set it false on "-" click.

    Here is the code to set "+"  as image in header cell.


    <span class="Apple-style-span" style="border-collapse:separate;font-family:Tahoma;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;"><span class="Apple-style-span" style="font-size:12px;text-align:left;">

    FpSpread1.Sheets(0).ColumnHeader.Cells(0, 2).Renderer = New CustomHeader
    </span></span>Public Class CustomHeader
        Inherits FarPoint.Win.Spread.CellType.EnhancedRowHeaderRenderer
        Public Overrides Sub PaintHeader(ByVal g As System.Drawing.Graphics, ByVal r As System.Drawing.Rectangle, ByVal rectTextIn As System.Drawing.Rectangle, ByVal backColor As System.Drawing.Color, ByVal foreColor As System.Drawing.Color, ByVal font As System.Drawing.Font, ByVal halign As FarPoint.Win.HorizontalAlignment, ByVal valign As FarPoint.Win.VerticalAlignment, ByVal pressed As Boolean, ByVal focus As Boolean, ByVal text As String, ByVal textDown As String, ByVal nAlign As FarPoint.Win.ButtonTextAlign, ByVal textOrientation As FarPoint.Win.TextOrientation, ByVal wordWrap As Boolean, ByVal shadowSize As Integer, ByVal darkColor As System.Drawing.Color, ByVal lightColor As System.Drawing.Color, ByVal pictUp As System.Drawing.Image, ByVal pictDown As System.Drawing.Image, ByVal bLocked As Boolean, ByVal prefix As System.Drawing.Text.HotkeyPrefix, ByVal style As FarPoint.Win.VisualStyles, ByVal mouseOver As Boolean, ByVal rightToLeft As Boolean, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal textRotationAngle As Double)
            MyBase.PaintHeader(g, r, rectTextIn, backColor, foreColor, font, halign, valign, pressed, focus, text, textDown, nAlign, textOrientation, wordWrap, shadowSize, darkColor, lightColor, pictUp, pictDown, bLocked, prefix, style, mouseOver, rightToLeft, appearance, textRotationAngle)
            Dim b1 As Image = New Bitmap(GetType(FarPoint.Win.Spread.FpSpread).Assembly.GetManifestResourceStream(""))
            g.DrawImage(b1, New Point(r.Right - 20, r.Y + 1))

            Dim b1 As Image = New

            g.DrawImage(b1, New Point(r.Right - 20, r.Y + 1))
        End Sub
    End Class

    This might help you.






Need extra support?

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

Learn More

Forum Channels