How to select just a cell in the header area (with a click of the mouse)

Posted by: luigggye-fp on 8 September 2017, 2:25 pm EST

  • Posted 8 September 2017, 2:25 pm EST


    I want to perform a drag and drop operation between a header cell and other cell in the sheet.

    But if I do a click in any header cell, the column is selected, instead the cell that I clicked. (see the attached picture)

    Why this is happening?

    How to select just a cell in the header area (with a click of the mouse) in order to drag it to another cell of the sheet?

    Thanks in advance,



  • Replied 8 September 2017, 2:25 pm EST


    Header cells are not selected as they are not included in the data area. It is not allowed to make a header cell as active cell. As a work around you may remove the default header and use the first Row/Column as ColumnHeader/RowHeader.





  • Replied 8 September 2017, 2:25 pm EST

    Thanks for your response.

    It's mean that I can't drag a header cell and drop it to another cell in the header or data area?

    Thanks in advance,


  • Replied 8 September 2017, 2:25 pm EST


    As suggested by Deepak, you need to hide the Spread's default header and then make the first Row/Column as the header of the Spread and then you can drag and drop the cells, else in case you want to drag and drop default header cells, then it will move the complete Column rather than the single header cell.

  • Replied 8 September 2017, 2:25 pm EST

    <FONT face=arial,helvetica,sans-serif>Thanks for your responses.</FONT>

    <FONT face=arial,helvetica,sans-serif>As suggested by you, I already have hidden the header and then I have used the first Row/Column as a header.</FONT>

    <FONT face=arial,helvetica,sans-serif>I have read all the information about drag and drop existing in the Farpoint forum, but all this information was entered few years ago. So I am confused about the correct way to do that.</FONT>

    <FONT face=arial,helvetica,sans-serif>So, I really need a sample about drag and drop between cells.</FONT>

    <FONT face=arial,helvetica,sans-serif>I will perform the drag and drop operation only over the data area (because the header area is hidden) and I have used the first rows / columns as the header.</FONT>

    <FONT face=arial,helvetica,sans-serif>I want to drag a cell (a single cell, not a range of cells) and drop it in other area of the sheet. </FONT>

    <FONT face=arial,helvetica,sans-serif>The idea is:</FONT>

    <FONT face=arial,helvetica,sans-serif>Click the cell with the left buttom of the mouse and when I start to move the mouse, the drag operation must to start.</FONT>

    <FONT face=arial,helvetica,sans-serif>When the left buttom of the mouse is released, the source data must be placed in the target cell. (text and tag properties).</FONT>

    <SPAN id=result_box class=short_text><SPAN><FONT face=arial,helvetica,sans-serif>During the drag operation is in progres I always must to know about which cell is in pointer of the mouse. (I will do a few checks and possibly deny the drop).</FONT></SPAN></SPAN>

    <FONT face=arial,helvetica,sans-serif>When the mouse is released (the drop operation is started), I want to know the source cell as well as the target cell, because I must to perform some process (delete a column or row, add a column or row... etc).</FONT>

    <FONT face=arial,helvetica,sans-serif>I will appreciate so much if you can show me a sample.</FONT>

    <FONT face=arial,helvetica,sans-serif>Thanks in advance,</FONT>

    <FONT face=arial,helvetica,sans-serif>Luigggye</FONT> 


  • Replied 8 September 2017, 2:25 pm EST


    In order to allow DragDrop you need to set AllowDragDrop property to True, later using Spread's DragDropCompleted event you should be able to get the Row and Column index for the cells to/from the drag drop happened.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            FpSpread1.AllowDragDrop = True
        End Sub

     Private Sub FpSpread1_DragDropBlockCompleted(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragDropBlockCompletedEventArgs) Handles FpSpread1.DragDropBlockCompleted
            MsgBox(e.ColumnBegin & e.RowBegin & e.RowEnd & e.ColumnEnd)
     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