Customize ColumnHeader

Posted by: stephc on 8 September 2017, 3:18 pm EST

  • Posted 8 September 2017, 3:18 pm EST

    Can you tell me how to customize GradientHeader And SelectedBackgroundColor in columnheader in the same time.

    My code :  (VB)

    Dim GR As New CellType.GradientHeaderRenderer(Color.Red, Color.Yellow,, Color.White, Drawing2D.LinearGradientMode.Vertical)

    Dim Gri As New GridLine(GridLineType.Flat, Color.Blue)

    ' FP.ActiveSheet.VisualStyles = FarPoint.Win.VisualStyles.Off
    FP.ActiveSheet.ColumnHeader.Rows(0).Renderer = GR
    FP.ActiveSheet.ColumnHeader.VerticalGridLine = Gri

    Until then, it works fine but if I add the following code...

    Dim EC As New CellType.EnhancedColumnHeaderRenderer
    EC.SelectedBackgroundColor = Color.Goldenrod
    FP.ActiveSheet.ColumnHeader.Rows(0).Renderer = EC

    i have the good SelectedBackgroundColor but i lose then set gradient

    how to get the two together please ?

    Thank you for your help


    Traduit Par Google
  • Replied 8 September 2017, 3:18 pm EST


    I could replicate the issue mentioned by you and hence I am escalating it to the concerned team (tracking id : 116835).

    I will get back to you as soon I hear anything from them.

  • Marked as Answer

    Replied 8 September 2017, 3:18 pm EST


    We have heard back from the developers and as per them this requires a custom header renderer class which overrides the paint logic to draw like the customer wants; please see here for more info:

    Easiest way is to make a custom header renderer inheriting from a base renderer (flat, enhanced, etc.) matching the general appearance in the sheet, then override the paint logic in PaintHeader or PaintCell.

Need extra support?

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

Learn More

Forum Channels