Copy To Excel doesn't work in Batch Edit Mode

4 posts, 0 answers
  1. Greg
    Greg avatar
    4 posts
    Member since:
    Sep 2015

    Posted 10 Dec 2015 Link to this post

    Hi There,

    I am trying to Get 'Copy To Excel' to work in Batch Edit Mode. (GridEditMode.InCell)

    I used the Telerik example below (razor/grid/editing) and added the two following lines to be able to copy to Excel:

    .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
    .AllowCopy(true)

    (Telerik\UI for ASP.NET MVC Q2 2015\wrappers\aspnetmvc\Examples\VS2013)

    However, I am not able to copy to Excel.

    Here is the code with the added lines in bold:

    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()    
        .Name("Grid")    
        .Columns(columns => {        
            columns.Bound(p => p.ProductName);
            columns.Bound(p => p.UnitPrice).Width(140);
            columns.Bound(p => p.UnitsInStock).Width(140);
            columns.Bound(p => p.Discontinued).Width(100);
            columns.Command(command => command.Destroy()).Width(110);
        })
        .ToolBar(toolbar => {
            toolbar.Create();
            toolbar.Save();        
        })
        .Editable(editable => editable.Mode(GridEditMode.InCell))
        .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
        .AllowCopy(true)

        .Pageable()
        .Navigatable()
        .Sortable()
        .Scrollable()
        .DataSource(dataSource => dataSource        
            .Ajax()         
            .Batch(true)
            .PageSize(20)
            .ServerOperation(false)                
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.ProductID))
            .Create("Editing_Create", "Grid")
            .Read("Editing_Read", "Grid")
            .Update("Editing_Update", "Grid")
            .Destroy("Editing_Destroy", "Grid")
        )
    )

    Cheers,

    Greg

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 10 Dec 2015 Link to this post

    Hello Greg,

    I was unable to reproduce the problem on my end. Selecting some cells and pressing Ctrl+C copies the values as expected to Excel. Is this not the case on your end? If the problem is still reproducing, please send us runnable example that demonstrates it, so we could take a look.

    Regards,
    Dimiter Madjarov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Greg
    Greg avatar
    4 posts
    Member since:
    Sep 2015

    Posted 10 Dec 2015 in reply to Dimiter Madjarov Link to this post

    Hi Dimiter,

     Thanks for the quick response.

    I have an update on this:

    - My code snippet above works when I run it in Internet Explorer 8 (i.e. I am able to copy and paste into Excel)

    - My code snippet above does not work when I run it in Chrome (Version 46.0.2490.86 m)

    If I run the the other example (razor/grid/copy_to_excel) then I can copy to Excel from Chrome too but not with (razor/grid/editing) and the additional two lines of code.

    Do you think there is a workaround for this? I do not have the flexibility to change browser nor upgrade chrome.

    Cheers,

    Greg

  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 11 Dec 2015 Link to this post

    Hello Greg,

    We cannot reproduce the issue in our demos in neither browser. If the problem is still existing, please create small example, in which you are experiencing it, and send it to us so we could take a look at it locally.

    Regards,
    Dimiter Madjarov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready