Skip to main content
All docs
V26.1
  • ColumnDragOverEventArgs Class

    Contains data for the ColumnDragOver event.

    Namespace: DevExpress.Xpf.Grid

    Assembly: DevExpress.Xpf.Grid.v26.1.Core.dll

    Declaration

    public class ColumnDragOverEventArgs :
        CancelRoutedEventArgs

    Remarks

    Set the CancelRoutedEventArgs.Cancel property to true to cancel the ColumnDragOver event.

    Available Parameters

    The ColumnDragOverEventArgs class includes parameters that allow you to modify predefined drag & drop functionality within a ColumnDragOver event handler.

    Source Parameters

    SourceArea
    Gets the source area where the drag operation started.
    SourceBand
    Gets the source band where the drag operation started.
    SourceBandIndex
    Gets the index of the source band where the drag operation started.
    SourceBandRowIndex
    Gets the row index of the source band where the drag operation started.
    SourceColumn
    Gets the source column or band where the drag operation started.
    SourceIndex
    Gets the index of the source column or band where the drag operation started.
    SourceView
    Gets the source view where the drag operation started.

    Target Parameters

    TargetArea
    Gets the target area where the dragged item is about to be dropped.
    TargetBand
    Gets the target band where the dragged item is about to be dropped.
    TargetBandIndex
    Gets the index of the target band where the dragged item is about to be dropped.
    TargetBandRowIndex
    Gets the row index of the target band where the dragged item is about to be dropped.
    TargetColumn
    Gets the target column or band where the dragged item is about to be dropped.
    TargetIndex
    Gets the index of the target column or band where the dragged item is about to be dropped.

    Example

    The following code snippet prevents users from dropping columns or bands into a certain position:

    private void TableView_ColumnDragOver(object sender, ColumnDragOverEventArgs e) {
        // Prevent users from dropping columns or bands into the last column
        if (e.TargetArea == HeaderArea.ColumnHeader && e.TargetIndex == grid.Columns.Count - 1) {
            e.Cancel = true;
        }
        // Prevent users from dropping columns or bands before the "ID" column
        int idIndex = grid.Columns["ID"].VisibleIndex;
        if (e.TargetArea == HeaderArea.ColumnHeader && e.TargetIndex == idIndex) {
            e.Cancel = true;
        }
    }
    

    Inheritance

    See Also