Skip to main content
All docs

Spreadsheet Localization

The ASPxSpreadsheet control can be localized for specific languages and locales. Most UI elements support the standard localization mechanism. However, the control generates some elements (for instance, the context menu and its items) completely on the client and the solution with custom assemblies cannot be used here. For such elements, we have a separate localization mechanism. This topic describes how to localize the Spreadsheet’s client elements.

Localization strings for client elements are specified inside the ASPxSpreadsheet control and sent to the client as a hash table. On the client, you can access these strings in the ASPxClientSpreadsheet.Localization object.

To override the localization strings, you can handle the Spreadsheet’s Init event:

<dx:ASPxSpreadsheet ID="ASPxSpreadsheet1" runat="server" WorkDirectory="~/App_Data/WorkDirectory">
    <ClientSideEvents Init="onSpreadsheetInit" />

In the event handler, specify new values for the strings contained in the ASPxClientSpreadsheet.Localization object:

function onSpreadsheetInit(s, e) {
    ASPxClientSpreadsheet.Localization["MenuCmd_FormatClearContents"] = "Tyhjennä sisältö";
    ASPxClientSpreadsheet.Localization["MenuCmd_InsertComment"] = "Uusi kommentti";