Kendo Grid, add edit and delete button inside dropdown

1 Answer 64 Views
Grid
Jan-Frederik
Top achievements
Rank 1
Iron
Iron
Jan-Frederik asked on 16 Jan 2024, 08:16 AM

I have a kendo grid with inline editing and would like to put the edit and delete button inside a dropdown.

Before code:

columns.Command(command =>
{
   command.Edit();
   command.Destroy();
 }).Width(70);

I came up with the following markup

columns.Bound(x => x.Id).Title(" ").IncludeInMenu(false).ClientTemplate(
   @"<div class='btn-group'>
   <a role='button' class='k-button k-button-icontext k-grid-edit' href='\\#'><span class='k-icon k-i-edit'></span>Edit</a>
   <a class='k-button k-button-icontext dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
       <span class='caret'></span>
   </a>
   <ul class='dropdown-menu'>
      <li><a role='button' class='k-button k-button-icontext k-grid-delete' href='\\#'><span class='k-icon k-i-close'></span>Delete</a></li>
   </ul>
   </div>")
.Width(80);
This is basically ok, but the problem is that after clicking the edit button, the Update/Cancel buttons are not displayed. Is there a way to fix this issue?

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 19 Jan 2024, 07:24 AM

Hello Jan-Frederik,

Thank you for the code snippets and the details provided.

As the Edit and Delete buttons are custom implemented, the Update and the Cancel buttons should also be custom added.

Feel free to use the same approach in the "Edit" Event of the Grid.

Kind Regards,
Anton Mironov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.

Tags
Grid
Asked by
Jan-Frederik
Top achievements
Rank 1
Iron
Iron
Answers by
Anton Mironov
Telerik team
Share this question
or