This is a migrated thread and some comments may be shown as answers.
I need my custom delete button, to delete records associated with my check box while batch editing is enabled.
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
David asked on 05 Feb 2020, 07:15 PM

I currently have a a custom delete button in my toolbar. I want it to delete any record that has a check beside it in the grid with my Checkbox column. I also have batch editing enabled as well as Selectable as a way to see which record correlates with what you are doing. Here is my code. 


      .DataSource(dataSource => dataSource
          .Model(model => model.Id(p => p.Proposal_Uid))
          .Read(read => read.Action("Proposals_Read", "Grid"))
          .Create(create => create.Action("Proposals_Create", "Grid"))
          .Update(update => update.Action("Proposals_Update", "Grid"))
          .Destroy(destroy => destroy.Action("Proposals_Destroy", "Grid"))
          .Resizable(resize => resize.Columns(true))

      .Columns(columns =>
          columns.Bound(c => c.Pr).Width(215);
          columns.Bound(c => c.P).Width(200);
          columns.Bound(c => c.C).Width(190);
          columns.Bound(c => c.Cli).Width(185);
          columns.Bound(c => c.Total).Width(290);
          columns.Bound(c => c.Md).Width(220);
          columns.Bound(c => c.Start_Date).Format("{0: dd/MM/yyyy}").Width(170);
          columns.Bound(c => c.End_Date).Format("{0: dd/MM/yyyy}").Width(170);
          columns.Bound(c => c.Pqr).Width(235);
          columns.Bound(c => c.Co).Width(215);
      .ToolBar(toolbar =>
          toolbar.Custom().Text("Delete").Name("Destroy").IconClass("k-icon k-i-close");
      .Editable(editable => editable.Mode(GridEditMode.InCell))
      .Selectable(selectable =>
      .Filterable(filterable => filterable.Mode(GridFilterMode.Row))
      .HtmlAttributes(new { style = "height:835px;" })



It should delete from the grid AND my server when I put a checkmark in the check box and hit the delete button in the tool bar. It should also Delete as many records as I choose, and if I put a check in the box at the column header, it should delete all records. It should also only give 1 event of deletion regardless of how many records are actually deleted. I know I need a script, but I currently don't know how to write it correctly. Any help would be appreciated. 

1 Answer, 1 is accepted

Sort by
Alex Hajigeorgieva
Telerik team
answered on 06 Feb 2020, 02:26 PM

Hi, David,

I believe that the original forum post has all the information necessary so I suggest we treat this as duplicate and continue the conversation there. I responded to you in this post:

Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.
Asked by
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question