WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

[Feature] DataGrid - Cell copy, paste, drag-fill

Open deathmetallic opened this issue 1 year ago • 2 comments

Describe the problem

To do data entry into DataGrid the user must click into a cell's Editing mode, then enter data (text, date, other controls, etc). For smaller applications this is fine, but if needing to do a lot of data entry (e.g. enter data for 300 grid items) it would take a very long time to enter the data. There does not appear to be anything built into the API to easily copy/paste data between cells (when not in the Editing mode) or other editing options to reduce data entry time.

As is, the DataGrid editing functionality is really only good for smaller-scale datasets or where infrequent edits are needed. For larger datasets/data entry it becomes tedious to enter/update data in larger quantities.

Describe the solution

It would be useful to add drag-fill and copy/paste functions to DataGrid similar to Excel spreadsheet functionality.

  • If some property (such as DragFillDirection) is configured on the DataGrid, the user can fill a cell in the direction configured (Not allowed, Vertical, Horizontal, Omnidirectional). If DragFillDirection is some other value than "not allowed", a Fill handle and indicator (such as the Excel plus icon) would be displayed in the bottom-right of the cell to indicate the fill operation.
  • If some properties (such as IsCellCopyAllowed, IsCellPasteAllowed, IsCellCutAllowed) are enabled on the DataGrid, the user can copy/cut range/row data to the Clipboard in a format that can be pasted into another DataGrid or possibly Excel.

Alternatives

Some third-party controls have this functionality, but it either very expensive or not compatible with UWP projects. Not having this as part of the API would require developers to create custom, moderate-complexity code to accomplish these functions.

Because these functions are somewhat standard in spreadsheet applications and a "standard" implementation as described above would likely be useful with limited modification needed from the API standard (it would likely not be common for this functionality to often need to be changed from how it works out-of-the-box DataGrid), I would suggest this as a feature for implementation into the DataGrid control.

Additional info

Here are some screenshots of the Excel drag-fill and copy/paste function for anyone not familiar. image image image image

This is what the Excel cell looks like when selected, with a Fill indicator in the bottom-right image

When the user hovers over the indicator and/or begins drag/drop in Excel, the cursor icon turns into the plus symbol. image

Help us help you

No.

deathmetallic avatar May 04 '23 20:05 deathmetallic