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

Grid batch edit - how to change the delete button to an image type button?

1 Answer 286 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BitShift
Top achievements
Rank 1
Veteran
BitShift asked on 03 Jan 2020, 12:14 AM

In this example

https://demos.telerik.com/aspnet-core/grid/editing

How could one show a image button instead of a command type button for the delete function?

Also, similar to the last question - will this example work with partial page updates?  In other words will the updating of the grid cause the entire view its contained within to be refreshed?

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 07 Jan 2020, 12:01 PM

Hi, Randal,

The easiest way to achieve the desired result is to add a custom button with a name "delete". This will automatically add a class to the the button "k-grid-delete" to which a click handler is internally attached to remove the row.

You can then add the image via CSS:

<style>
     .k-grid-delete {
         background-image:url(@Url.Content("~/assets/my-destroy.png"));
         background-repeat:no-repeat;
     }
 </style>

columns.Command(c => c.Custom("delete").Text(" "));

Give this a try and let me know in case you need further assistance. 

As for the second question - the answer is that only the grid will update, nothing else - and I have posted it in the other forum thread:

https://www.telerik.com/forums/grid-editing-and-partial-page-updates#7eZOiWE8YEOQrctyO533HQ

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

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