Version

ColumnDragStart Event

This event is raised when a column drag operation is about to begin.
Syntax
'Declaration
 
Public Event ColumnDragStart As EventHandler(Of ColumnDragStartEventArgs)
public event EventHandler<ColumnDragStartEventArgs> ColumnDragStart
Event Data

The event handler receives an argument of type ColumnDragStartEventArgs containing data related to this event. The following ColumnDragStartEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from Infragistics.CancellableEventArgs) 
Column (Inherited from Infragistics.Controls.Grids.CancellableColumnEventArgs)The CancellableColumnEventArgs.Column that this event was triggered for.
Example
This topic demonstrates how to handle the ColumnDragStart event which is fired the moment right before a drag operation is performed on a column.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

AddHandler Me.MyGrid.ColumnDragStart, AddressOf MyGrid_ColumnDragStart

Private Sub dataGrid_ColumnDragStart(ByVal sender As System.Object, ByVal e As ColumnDragStartEventArgs)
   ' If the column being moved is ProductName, cancel the event
   If (e.Column.Key.Equals("ProductName")) Then
      System.Diagnostics.Debug.WriteLine("ProductName column cannot be moved")
      e.Cancel = True
      Return
   End If
   System.Diagnostics.Debug.WriteLine("Column " + e.Column.Key.ToString + " about to move")
End Sub
this.MyGrid.ColumnDragStart += new EventHandler<ColumnDragStartEventArgs>(MyGrid_ColumnDragStart);

void MyGrid_ColumnDragStart(object sender, ColumnDragStartEventArgs e)
{
   // If the column being moved is ProductName, cancel the event
   if (e.Column.Key.Equals("ProductName"))
   {
      System.Diagnostics.Debug.WriteLine("ProductName column cannot be moved");
      e.Cancel = true;
      return;
   }
   System.Diagnostics.Debug.WriteLine("Column " + e.Column.Key + " about to  move ");
}
<ig:XamGrid x:Name="MyGrid"   
    
ColumnDragStart="MyGrid_ColumnDragStart">          
</ig:XamGrid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also