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

Copy To Excel doesn't work in Batch Edit Mode

3 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 10 Dec 2015, 10:16 AM

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

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 10 Dec 2015, 11:30 AM

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
0
Greg
Top achievements
Rank 1
answered on 11 Dec 2015, 01:21 AM

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

0
Dimiter Madjarov
Telerik team
answered on 11 Dec 2015, 09:22 AM

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
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Greg
Top achievements
Rank 1
Share this question
or