How to add a custom button in Telerik MVC Grid Column with Edit and delete Button

Telerik MVC Razor Code :
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);                                    commands.Custom("myButtonName").ButtonType(GridButtonType.Image).Action("myAction","myController").Ajax(true);
commands.Delete().ButtonType(GridButtonType.Image);
});



Javascript Code :
You can also assign a custom style to the button by using client side event onRowDataBound. Here is the code.

function onRowDataBound(e) {

var del = $(e.row).find($('.t-icon.t-ProcessPayment'));
        del.css('background-image', 'url("/Content/Images/SettingsBG.png")');
        del.css('background-repeat', 'no-repeat;');
        del.css('background-position-x', 0);
        del.css('background-position-y', 0);
}


                                                               


Comments

Popular Posts

GREYCstoration Oil Paint plugin for Photoshop

Service Bus Gateway service stuck at Starting

PowerApps SubmitForm not clearing People Picker value

Apple iPhone sending SMS automatically 00447786205094

Download file failed signature verification and may have been tampered with - Workflow Manger 1.0 Refresh (CU2)