New to Telerik UI for ASP.NET MVC? Download free 30-day trial

ASP.NET MVC Grid Paste from Excel

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
paste_from_excel.cshtml
Paste_From_ExcelController.cs
OrderViewModel.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

The Telerik UI for ASP.NET MVC Data Grid provides a built-in paste functionality that allows you to copy cells from MS Excel or another Grid component and paste them in the desired Grid. Based on the selected pasting operation, you can either replace the selected Grid cells with the copied cells or insert them as a new Grid row.

To enable the paste operations of the Grid:

  • Add the AllowPaste(true) option.
  • Make the Grid selectable by setting .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell)).
  • Enable the keyboard navigation functionality through the Navigatable() method.
  • Include the Paste() command in the Grid's ToolBar to display a dropdown control with the available paste operations—Insert (Paste (Insert)) and Replace (Paste (Replace)) modes.

This demo shows how to implement the paste feature of the Data Grid to insert new rows or replace the selected cells with the copied cells from an Excel document or other Telerik UI for ASP.NET MVC Grids.

Additional Apps

This Grid example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see all Telerik ASP.NET MVC components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in the ThemeBuilder.

Support & Learning Resources

Additional Resources