HELP! AllowColumnMove problem

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

  • Posted 8 September 2017, 12:40 pm EST

    <font size="2"><font face="Arial">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.
    </font></font>
  • 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.

     <PRE class=coloredcode> <SPAN class=kwd>Private Sub</SPAN> fps_Test_ColumnDragMove(<SPAN class=kwd>ByVal</SPAN> sender <SPAN class=kwd>As Object</SPAN>, <SPAN class=kwd>ByVal</SPAN> e <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.DragMoveEventArgs) <SPAN class=kwd>Handles</SPAN> fps_Test.ColumnDragMove
    <SPAN class=kwd>Try</SPAN>
    e.MoveContent = <SPAN class=kwd>True

    Catch</SPAN> ex <SPAN class=kwd>As</SPAN> Exception
    MessageBox.Show(ex.ToString)
    <SPAN class=kwd>End Try
    End Sub

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