HELP! AllowColumnMove problem

Posted by: gemini78 on 8 September 2017, 12:40 pm EST

  • Posted 8 September 2017, 12:40 pm EST

    I'm a bit in a bind regarding the AllowColumnMove property... I have a merged column header that has a text and combobox celltype on it. Is there any way I can be able to move the merged column using the ColumnDragMove property?

    Any suggestions would be greatly appreciated...

    Thanks in advance.
  • Replied 8 September 2017, 12:40 pm EST

    Hi Scott.

    I attached a sample project for the column move function. In the project, dragging the Age column results to an error.

    any input would be much appreciated..
    thanks in advance..


    2007/07/ColumnDragSample.zip
  • Replied 8 September 2017, 12:40 pm EST

    Hello,


    If you want the spanned cell to move with the column you are moving, you will need to write code to programatically implement this. You can catch the ColumnDragMoveCompleted event to be notified of this action.

  • Replied 8 September 2017, 12:40 pm EST

    Hello,


    I am able to move the spanned cell to a new location my moving the column. Make sure you have the latest maintenance release. If you do, could you post a small zipped project reproducing this for us to debug?

  • Replied 8 September 2017, 12:40 pm EST

    Hello Scott,

    I am currently using the Spread for .NET 2.5J Windows Form Ed(Japanese). During initialization, I merged some parts of the column header hence when I create a row for it, it would display a text and combobox celltype on it. Moving the merged column header doesn't seem to work. Is there any release for the japanese version? Could you give me any advice on how to solve this one?

    thanks again...
  • Replied 8 September 2017, 12:40 pm EST

    Hello,


    I am not sure how you are reproducing this behavior. Could you post a small zipped project for us to debug this issue?

  • Replied 8 September 2017, 12:40 pm EST

    Hi Scott.

    Can you give a sample code how to go about this? I tried using MoveColumn function during the ColumnDragMoveCompleted event but it doesn't seem to work.

    Thanks for the help.
  • Replied 8 September 2017, 12:40 pm EST

    Hello,


    Here is code I used to get this to work correctly.

     
    	Private Sub fps_Test_ColumnDragMove(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragMoveEventArgs) Handles fps_Test.ColumnDragMove
    Try
    e.MoveContent = True

    Catch
    ex As Exception
    MessageBox.Show(ex.ToString)
    End Try
    End Sub

    Private Sub
    fps_Test_ColumnDragMoveCompleted(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragMoveCompletedEventArgs) Handles fps_Test.ColumnDragMoveCompleted
    Try
    Dim
    cnt As Integer = fps_Test.Sheets(0).ColumnHeader.Cells(0, e.ToIndex).ColumnSpan
    fps_Test.Sheets(0).ColumnHeader.Cells(0, e.ToIndex).ColumnSpan = 1
    If cnt > 1 Then
    For
    i As Integer = 1 To cnt - 1
    fps_Test.Sheets(0).MoveColumn(e.FromIndex + i, e.ToIndex + i, True)
    Next
    fps_Test.Sheets(0).ColumnHeader.Cells(0, e.ToIndex).ColumnSpan = cnt
    End If
    Catch
    ex As Exception
    MessageBox.Show(ex.ToString)
    End Try
    End Sub

     
  • Replied 8 September 2017, 12:40 pm EST

    Hi Scott.

    Thank you for the help. It helped a lot...
Need extra support?

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

Learn More

Forum Channels