Change built-in toolbar label and tooltip

Hi,

This could be a simple request, but I haven't managed to find a solution.
I would like to change the text for the default toolbar items. For example, instead of showing Add, it should show New.

Thank you,
Andrei

3 Replies 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team July 20, 2020 04:09 AM UTC

Hi Andrei, 

Greeting from syncfusion support. 

Query : I would like to change the text for the default toolbar items 

You can customize the default text in Grid by using localization. Please refer the below code example and sample for more information. 


<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" allowPaging="true" locale="en-US" allowGrouping="true" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })"> 
    <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings> 
    <e-grid-pagesettings pageCount="6"></e-grid-pagesettings> 
    <e-grid-columns> 
        <e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" width="120"></e-grid-column> 
        <e-grid-column field="CustomerID" headerText="Customer Name" width="150"></e-grid-column> 
        <e-grid-column field="ShipCity" headerText="Ship City" width="170"></e-grid-column> 
        <e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column> 
    </e-grid-columns> 
</ejs-grid> 
 
<script> 
    ej.base.L10n.load({ 
        'en-US': { 
            'grid': { 
// change the default text used in the grid as you want 
                'Add': 'New', 
                'Edit': 'Modify', 
                'Cancel': 'Back', 
                'Update': 'Save', 
                'Delete': 'Remove', 
            } 
        } 
    }); 
</script> 


Note : en-US is the default locale applied to all the EJ2 Controls. 


Find the localization documentation for your reference. 


Please get back to us if you need further assistance on this. 

Regards, 
Rajapandiyan S

Marked as answer

AN Andrei July 20, 2020 06:01 AM UTC

Hello,

Like I've said before: simple and easy solution. It worked.

Thank you for the support.


RS Rajapandiyan Settu Syncfusion Team July 21, 2020 09:04 AM UTC

Hi Andrei, 

We are glad that the provided solution resolved your requirement. Please get back to us if you need further assistance on this. 

Regards, 
Rajapandiyan S 


Loader.
Up arrow icon