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

How to add "k-selected" to the row with ContextMenu function

1 Answer 348 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 06 Aug 2018, 07:22 PM

Hello,

         I am using ContextMenu provided by Kendo UI Angular for grid. However, my question is, how to add "k-selected" class to the row when I right click the row with the default ContextMenu function. The ContextMenu function works, but the row will not be selected, I mean I need to "k-selected" class to the row to make selection more obvious. How can I do that? Thanks for your help.

 

James

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 08 Aug 2018, 11:26 AM
Hello James,


This could be achieved by utilizing the Kendo Grid SelectionDirective

https://www.telerik.com/kendo-angular-ui/components/grid/selection/#toc-persisting-the-selection

and updating the selectedKeys collection when the context menu is displayed.
Here is a sample implementation that could be used as a base and updated further if needed

https://plnkr.co/edit/AOKKlcgFKlyyxmFn8cUs?p=preview

Regards,
Dimiter Madjarov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or