'Declaration Public Event ColumnDragStart As EventHandler(Of ColumnDragStartEventArgs)
public event EventHandler<ColumnDragStartEventArgs> ColumnDragStart
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.
Property | Description |
---|---|
Cancel (Inherited from Infragistics.CancellableEventArgs) | |
Column (Inherited from Infragistics.Controls.Grids.CancellableColumnEventArgs) | The CancellableColumnEventArgs.Column that this event was triggered for. |
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 "); }
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