MVC rid - Paste data from excel

2 posts, 0 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    May 2017

    Posted 24 Jul 2017 Link to this post

    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.


  2. Stefan
    Stefan avatar
    3009 posts

    Posted 26 Jul 2017 Link to this post

    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 visualization (charts) and form elements.
Back to Top