Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataGrid.ColumnReordering Event

Occurs before a DataGrid column moves to a new position in the display order.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)
public event EventHandler<DataGridColumnReorderingEventArgs> ColumnReordering
<sdk:DataGrid ColumnReordering="eventhandler"/>

You can handle this event to customize the visual display of a column header drag-and-drop operation, or to replace the default drag-and-drop behavior completely. To customize the appearance of the dragged column header and the drop location indicator, set the DragIndicator and DropLocationIndicator properties. To replace the default behavior completely, set the Cancel property to true and then provide your own drag-and-drop implementation.

NoteNote:

When you set the Cancel property to true, the ColumnHeaderDragStarted, ColumnHeaderDragDelta, ColumnHeaderDragCompleted, and ColumnReordered events do not occur.

Users can change the column order by dragging column headers only if the CanUserReorderColumns property is true.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.