[]
        
(Showing Draft Content)

Drag and Drop

Spread for WPF allows you to drag and move or drag and copy column, row, and cell range data using your mouse. Use the DragDropMode enumeration to perform the drag and drop operations in a worksheet. This enumeration provides the following values:

Value

Description

All

Drag and drop rows, columns, or selected cell ranges.

Column

Drag and drop only column(s).

Row

Drag and drop only row(s).

Range

Drag and drop the selected cell range.

None

Does not allow drag and drop any rows, columns, or selected range.

Supported drag and drop features

The drag and drop feature enables moving and copying the following features:

  • Cell values, formulas, and styles

  • Merged cells

  • Conditional formatted cells

  • Auto-filtered cell ranges

  • Table configurations

  • Data validations

  • Row height, column width, and hidden rows or columns

  • Group outlines associated with the range

  • Undo/Redo operations

Unsupported drag and drop operations

The drag and drop feature does not support the following operations:

  • Drag and drop a merged cell within a table or across intersecting areas

  • Drag and drop a cell to the inside or intersecting areas of a merged cell

  • Moving or copying of header data of a selected range

  • Data of newly added rows

Drag and Move Data

You can drag and move the data of a selected cell range by using the mouse. To do this, move the pointer to the edge of the selected cell, column, row, or selected cell range and then click and hold the mouse button. While moving the selected range, a text tip is displayed to help show the target location. When you release the mouse button, the selected cell range is relocated to the new location.


Drag and Copy Data

You can drag and copy the selected cell range using the mouse. To do this, move the pointer to the edge of the selected cell range and then click and hold the mouse button while pressing the Ctrl key. While copying the range, a text tip is displayed to help show the target location. After you release the mouse button, the selected cell range is copied to the new location.


The following example code shows hot to set the drag and drop feature for a selected cell range using DragDropMode enumeration in both the XAML view and the code view.

XAML

<Grid>
   <gss:GcSpreadSheet x:Name="spreadSheet1" DragDropMode ="Range" />
</Grid>

C#

// Set DragDropMode to "Range".
spreadSheet1.DragDropMode = DragDropMode.Range;

VB

' Set DragDropMode to "Range".
spreadSheet1.DragDropMode = DragDropMode.Range