This is a migrated thread and some comments may be shown as answers.

MVC rid - Paste data from excel

1 Answer 95 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Mark asked on 24 Jul 2017, 07:57 AM

Is it possible to paste data from Excel and have the create method fire to append each inserted row?

The example from the documentation ( simply replaces the existing grid's datasource whereas I would like to append each row that is pasted in so that it maintains the existing data and adds the newly pasted data.

My example Grid currently looks like:

.Columns(columns =>
columns.Bound(p => p.ID).Hidden();
columns.Bound(p => p.Description);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);

.Editable(editable => editable.Mode(GridEditMode.InLine))

.DataSource(dataSource => dataSource // Configure the grid data source
.Events(events => events.Error("window.KendoGrid_Error"))
.Model(model =>
model.Id(i => i.ID); // Specify the property which is the unique identifier of the model.
model.Field(i => i.ID).Editable(false);
.Create(update => update.Action("Create", "Test"))
.Read(read => read.Action("Read", "Test"))
.Update(update => update.Action("Edit"))
.Destroy(update => update.Action("Delete", "Test"))

Any help would be appreciated.


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 26 Jul 2017, 05:58 AM
Hello Mark,

The desired result can be achieved by retrieving the current data before adding the new one. The data can be retrieved using the data method of the dataSource:

// This is the changed line
data =;
           for (var i = 0; i < rows.length; i++) {
             var cells = rows[i].split('\t');
               Name: cells[0],
               Age: cells[1]

I hope this is helpful.

Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question