Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Moving columns within group, prevent verticle stacking behaviour

I am trying to prevent certain column moving within a group when using "Row layout within groups". I have turned on within group only which prevents me moving the columns outside of their group, good. However, there is no option to prevent the moving of a column to a different vertical position within that group, but allow moving it horizontal. See below for what I mean.

I have tried controlling it with the following code, but it only prevents me dropping the column below but not above...

Private Sub ugrStaffing_BeforeColPosChanged(sender As Object, e As BeforeColPosChangedEventArgs) Handles ugrStaffing.BeforeColPosChanged

If e.PosChanged = PosChanged.Moved Then

If e.ColumnHeaders(0).Column.RowLayoutColumnInfo.OriginY > 0 Or e.ColumnHeaders(0).Column.RowLayoutColumnInfo.OriginY < 0 Then

e.Cancel = True

End If

End If

End Sub



  • 48586
    Verified Answer



    You should set AllowRowLayoutColMoving  to AllowOriginXChange


    e.Layout.Override.AllowRowLayoutColMoving = Infragistics.Win.Layout.GridBagLayoutAllowMoving.AllowOriginXChange;


    Please let me know if you have any further questions.