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

Custom command template

1 Answer 265 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Aldo
Top achievements
Rank 2
Aldo asked on 01 Dec 2016, 05:51 PM

Hi, i've a treelist with custom command, 

and i'm trying to change the button template with the databound event like the Grid

the visual result it's ok, but the event click doesn't fire, probably because i remove the k-button class.

but if leave the class the button doesn't template.

columns.Add().Command(command =>
                 {
                     command.Custom().ClassName("k-grid-EditCustom").Text(" ").Name("EditCustom").Click("editGroup");
                     command.Custom().ClassName("k-grid-DeleteCustom").Text(" ").Name("DeleteCustom").Click("deleteGroup");
 
                 }).Width(150);
 
function treeGridGroup_DataBound(e) {
     e.sender.tbody.find(".k-grid-EditCustom").removeClass("k-button")
     e.sender.tbody.find(".k-grid-EditCustom").addClass("btn btn-warning btn-outline fa fa-pencil");
 
     e.sender.tbody.find(".k-grid-DeleteCustom").removeClass("k-button")
     e.sender.tbody.find(".k-grid-DeleteCustom").addClass("btn btn-danger btn-outline fa fa-trash-o m-l-5");
 }

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 05 Dec 2016, 02:24 PM
Hi Aldo,

Could you please let me know what changes you are trying to perform on the custom buttons? I am afraid you cannot remove the k-button class since its is used to wire up the click event of the button. However, you can add additional class to customize the appears of the button and use a CSS rule with higher specificity.

Regards,
Kostadin
Telerik by Progress
Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Tags
TreeList
Asked by
Aldo
Top achievements
Rank 2
Answers by
Kostadin
Telerik team
Share this question
or