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

Select Text for Copy/Paste with Multiple Row Select Enabled

1 Answer 260 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 19 Feb 2016, 08:06 PM

In my search to resolve an issue I'm having, I found this post:

 

http://www.telerik.com/forums/select-text-although-allowrowselect-is-true

 

How do we set the EnableDragToSelectRows property to false using the Telerik UI for ASP.NET MVC (powered by Kendo UI) grid?  I have this applied:

 

.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))

 

...and need to disable the marquee select so the users can select and copy text.  Thank you!

-Anthony

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 22 Feb 2016, 06:54 AM

Hello Anthony,

This forum thread is very old and is related to the UI for ASP.NET AJAX Grid, not the Kendo UI Grid. The current behavior is not supported in the Kendo UI Grid - if the selection is set to multiple, the Grid will provide both option - click and drag for selection.

A possible workaround would be to disable the selection and manually attach a click handler to the Grid rows, that will add the k-state-selected CSS class to them.
E.g.

$("#grid").on("click", "tr[role='row']", function(){
   $(this).toggleClass("k-state-selected");
});

In this case you could retrieve the selected rows via jQuery, instead of using the built in select() API method.
E.g.
var selected = $("#grid tbody tr.k-state-selected");

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