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

Work with selection to paste to

3 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 10 Jul 2015, 11:05 PM

Hi,

I thought I'd ask on here first, but I am struggling to find any nice way to paste into the grid selected cells. 

 I am using multiple cell selection:

 

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

I am anticipating I need to manually handle the paste event by registering for the paste event.

    $(function () {
 
        $("#weldgrid").bind("paste", function (e) {
         
        var pastedText = undefined;
            if (window.clipboardData && window.clipboardData.getData) {
                pastedText = window.clipboardData.getData('Text');
            } else if (e.clipboardData && e.clipboardData.getData) {
                pastedText = e.clipboardData.getData('text/plain');
            }
 
    // TODO:  Process input for tab/newlines
 
   // iterate through selected cells
   // write associated value to each one
 
    }
}
 

I've come across this thread already which went dead after one response.

http://www.telerik.com/forums/copy-and-paste-rows-in-kendo-ui-asp-net-mvc-grid

For me the demo does not work and the API Docs in IE11 are all over the place.  I am struggling to find my way around the layout/structure of the pages.

Now my question is, how can I nicely iterate through each cell in the range and set the value?

I can see that:

var grid = $("#grid").data("kendoGrid");
            var currentSelection = grid.select();
 
            currentSelection.each(function () {
    // $(this) is the selected cell
}

 

Thanks

Andez

 

 

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 15 Jul 2015, 08:01 AM

Hello Paul,

As the thread noted, pasting in the grid is not supported and is achieved via custom code. I'm afraid that we do not have any other examples on how to implement this.

Regards,
Alex Gyoshev
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
Paul
Top achievements
Rank 1
answered on 16 Jul 2015, 09:12 PM

That's a shame.

Is anything planned for a Grid with this functionality?

I've heard some talk saying this is more Spreadsheet behaviour.  Can we expect it in the Grid in future?  I would hope for it - given we get copy paste in standard Telerik Grid for WinForms and WPF.  Would be a very desirable feature.

Cheers

Paul

0
Atanas Georgiev
Telerik team
answered on 20 Jul 2015, 08:31 AM
Hello Paul,

We do not have immediate plans to include built in behavior for pasting in the grid. We will appreciate if you submit your ideas as feature requests at our UserVoice portal - this way the community would be able to evaluate it and we will consider them for future releases. Thank you in advance.

You may also want to take a look at our Roadmap for Q3 2015, which announces the expected introduction of Spreadsheet (Beta version) widget.

Regards,
Atanas Georgiev
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
Paul
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Paul
Top achievements
Rank 1
Atanas Georgiev
Telerik team
Share this question
or