How can I extract Header text from pixel location?

Posted by: xtr33me on 8 September 2017, 2:07 pm EST

  • Posted 8 September 2017, 2:07 pm EST

    We are currently performing a conversion from old VB6 .COM spread over to 4.0 .NET spread and I am having an issue getting the header info for my spread when in the MouseUp click event for my spread object.  It looks as if in the older versions one could access a method called GetHeaderFromPixel, but that doesn't seem to be available anymore. 

     So my end goal is to be able to throw up a context menu when the user selects one of the headers.  They then are shown a list of standard header titles in the context menu which they then select to assign that string to the column header title.  Currently I was trying to use "GetCellFromPixel" and then figured I would check to see if one of the properties returned anything for the headers but that wasn't the case.  I have been scouring the forums and Google for a bit now and figured I should just post to see if anyone may be able to shed some light on this issue and the best way to go about arriving at a solution.  Thanks all in advance for the help!


  • Replied 8 September 2017, 2:07 pm EST

    Hello Dan,

    We have GetColumnHeaderCellFromPixel Method for the cells in Column Header and GetRowHeaderCellFromPixel Method for the cells in Row Header in Spread for Windows Forms.

    However you may also use the CellClick Event to check if the Click is done over a Header Cell.Have a look at the below code snippet,

        Private Sub FpSpread1_CellClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles FpSpread1.CellClick
            If e.ColumnHeader = True Then
            End If
        End Sub

    I hope it will help you.



Need extra support?

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

Learn More

Forum Channels