How do I change the UpdateText and CancelText for the column-command tag using TagHelper?

1 Answer 91 Views
Grid
Brandon
Top achievements
Rank 1
Brandon asked on 19 Jan 2023, 05:20 PM

Hello,

When using HtmlHelper I can do something like this if I want to change the UpdateText and CancelText to blank: 

columns.Command(command => {
    command.Edit()
    .Text(" ")
    .UpdateText(" ")
    .CancelText(" ")
    .HtmlAttributes(new { title = "Edit" });

    command.Custom("Destroy")
    .Click("showDeleteConfirmation")
    .IconClass("k-icon k-i-trash")
    .Text(" ")
    .HtmlAttributes(new { title = "Delete" });
}).Width(75);

 

How do I accomplish the same thing with TagHelper? I tried checking to see if there's a canceltext or updatetext attribute but there is none. 

<column width="75" title="Commands">
    <commands>
        <column-command text=" " name="edit" title="Edit" ></column-command>                      
        <column-command text=" " name="cancel" title="Cancel" ></column-command>
    </commands>
</column>

 

Thank you.

1 Answer, 1 is accepted

Sort by
1
Accepted
Alexander
Telerik team
answered on 24 Jan 2023, 08:41 AM

Hi Brandon,

Thank you for reaching out.

To override the messages, I would recommend utilizing the built-in "messages" TagHelper attribute the Grid provides. From there, you can specify any arbitrary messages as per your requirements. Here is an example:

<kendo-grid name="grid">
	<messages>
	   <commands canceledit=" " update=" " edit=" " destroy=" " />
	</messages>
	<columns>
	 ...
	</columns>
</kendo-grid>

This would produce a result similar to this:

For your convenience, here is a Telerik REPL that further depicts the aforementioned suggestion:

Please give this suggestion a try and let me know how it works out for you.

Kind Regards,
Alexander
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Brandon
Top achievements
Rank 1
commented on 25 Jan 2023, 02:31 PM

Hi Alexander, that works! Thanks!
Tags
Grid
Asked by
Brandon
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or