The DevExpress ASP.NET MVC GridView (GridView) extension allows you to manage multiple cell in batch edit mode.
Users can select multiple cells with the mouse or keyboard:
- Click a cell and drag over cells while holding the left mouse button.
- Hold Shift and press the arrow keys to select a contiguous cell range. To add non-adjacent cells to the current selection, press Ctrl and click the cells.
Users can use keyboard and context menu to manage cells:
Copy and paste the selected cells in the same grid, or a sheet of an Excel file or Spreadsheet.
Select cells and press Ctrl+C. Select the cell range where you want to paste the copied cells and press Ctrl+V.
Paste a value in all selected cells.
Copy a value to the clipboard. Select the cells and press Ctrl+V to paste the copied value in all selected cells.
Use the context menu to copy/paste cell values.
Right-click the selected cells to invoke the context menu.
The GridView raises the MVCxClientGridView.CellSelectionChanging event when you select or unselect a cell. In this event handler, you can get the current selection state of the processed cell (e.newSelectionState) and disable selection (e.cancel).
You can also use the MVCxClientGridView.batchEditApi.GetSelectedCells method to get a collection of selected cells. The MVCxClientGridView.batchEditApi.SelectCell and MVCxClientGridView.batchEditApi.UnselectCell methods to select or unselect a cell.
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
The source code files for this demo are installed (by default) in the following directory:
Open CS Solution
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxGridViewDemos