Localization in EJ 1 ASP.NET MVC ComboBox

18 Nov 2018 / 2 minutes to read

The Localization library allows you to localize the static text content of the noRecordsTemplate and actionFailureTemplate  properties according to the culture currently assigned to the ComboBox.

Locale key en-US (default)
noRecordsTemplate No records found
actionFailureTemplate The request failed

Loading translations

To load translation object to your application, use the load function of L10n class.

In the following sample, French culture is set to the ComboBox and no data is loaded. Hence, the noRecordsTemplate property displays its text in French culture initially, and if the sample is run offline, the actionFailureTemplate property displays its text appropriately.

  • html
  • <div class="frame">
            <div class="control">
                        .Datasource(d => d.URL("//js.syncfusion.com/ejServices/wcf/NorthWind.svc/").Offline(false).CrossDomain(true))
                        .Query("ej.Query().from('Suppliers').select('SupplierID', 'ContactName').take(0)")
                        .ComboBoxFields(f => f.Text("ContactName").Value("SupplierID"))
                        .Placeholder("Sélectionnez un customer")
                    'noRecordsTemplate': "Aucun enregistrement trouvé",
                    'actionFailureTemplate': "Modèle d'échec d'action"
  • c#
  • public ActionResult Databindingremote()
                return View();