We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How I can change "Save" button text on Grid's Dialog Template

I've this

...
<ej:Grid ID="RegistroIngresoGrid" runat="server"
    AllowPaging="True" AllowScrolling="True" AllowSorting="True"
    OnServerEditRow="RegistroIngresoGrid_ServerEditRow"
    OnServerAddRow="RegistroIngresoGrid_ServerAddRow"
    OnServerDeleteRow="RegistroIngresoGrid_ServerDeleteRow"
    DataSourceCachingMode="Session">
    <ClientSideEvents ActionComplete="actionComplete" EndAdd="endAdd" EndDelete="endDelete" EndEdit="endEdit" />
    <ToolbarSettings ShowToolbar="true" ToolbarItems="add,edit">
    </ToolbarSettings>
    <Columns>
        <ej:Column Field="IdRegistro" Visible="false" IsPrimaryKey="true">
        </ej:Column>
        <ej:Column Field="FechaRegistro" HeaderText="Fecha Ingreso" Format="{0:dd/MM/yyyy}" Width="100">
            <ValidationRule>
                <ej:KeyValue Key="required" Value="true" />
                <ej:KeyValue Key="date" Value="true" />
            </ValidationRule>
        </ej:Column>
        <ej:Column Field="Diagnostico" HeaderText="Diagnostico">
            <ValidationRule>
                <ej:KeyValue Key="required" Value="true" />
                <ej:KeyValue Key="minlength" Value="3" />
            </ValidationRule>
        </ej:Column>
        <ej:Column Field="Procedimiento" HeaderText="Procedimiento">
            <ValidationRule>
                <ej:KeyValue Key="required" Value="true" />
                <ej:KeyValue Key="minlength" Value="3" />
            </ValidationRule>
        </ej:Column>
        <ej:Column Field="Medico" HeaderText="Medico">
            <ValidationRule>
                <ej:KeyValue Key="required" Value="true" />
                <ej:KeyValue Key="minlength" Value="3" />
            </ValidationRule>
        </ej:Column>
        <ej:Column Field="FechaProcedimiento" HeaderText="Fecha Procedimiento" Format="{0:dd/MM/yyyy}" Width="110">
            <ValidationRule>
                <ej:KeyValue Key="required" Value="true" />
                <ej:KeyValue Key="minlength" Value="3" />
            </ValidationRule>
        </ej:Column>
 
        <ej:Column HeaderText="" IsUnbound="True" Width="70">
            <Command>
                <ej:Commands Type="Amount">
                    <ButtonOptions Text="Montos" Width="70" Click="showDialogAmounts" />
                </ej:Commands>
 
            </Command>
        </ej:Column>
    </Columns>
    <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"
        EditMode="DialogTemplate" DialogEditorTemplateID="#template"></EditSettings>
 
</ej:Grid>
...

<script type="text/template" id="template">
 
      <asp:HiddenField ID="IdRegistro" Value="{{: IdRegistro}}" runat="server" />
      <asp:HiddenField ID="IdSolicitud" Value="{{: IdSolicitud}}" runat="server" />
      <asp:HiddenField ID="TieneAlta" Value="{{: TieneAlta}}" runat="server" />
      <asp:HiddenField ID="FechaAlta" Value="{{: FechaAlta}}" runat="server" />
 
      <table style="width720pxfont-weight600text-alignleft;" class="table-responsive">
 
          <tr>
              <td>Fecha Registro:</td>
              <td>
                  <asp:TextBox ID="FechaRegistro" value="{{: FechaRegistro}}" runat="server" CssClass="form-control" Enabled="false" DateFormat="dd/MM/yyyy"></asp:TextBox>
              </td>
              <td>Fecha Procedimiento:</td>
              <td>
 
                  <asp:TextBox ID="FechaProcedimiento" value="{{: FechaProcedimiento}}" runat="server" DateFormat="dd/MM/yyyy"></asp:TextBox>
              </td>
          </tr>
          <tr>
              <td>Diagnostico:
              </td>
              <td colspan="3">
                  <asp:TextBox ID="Diagnostico" value="{{: Diagnostico}}" runat="server" CssClass="form-control"></asp:TextBox>
                  <asp:HiddenField ID="IdDiagnostico" Value="{{: IdDiagnostico}}" runat="server" />
              </td>
 
          </tr>
          <tr>
              <td>Procedimiento:</td>
              <td colspan="3">
                  <asp:TextBox ID="Procedimiento" value="{{: Procedimiento}}" runat="server" CssClass="form-control"></asp:TextBox>
                  <asp:HiddenField ID="CodigoCPT" Value="{{: CodigoCPT}}" runat="server" />
              </td>
          </tr>
 
          <tr>
              <td>Doctor:</td>
              <td colspan="3">
                  <asp:TextBox ID="Medico" value="{{: Medico}}" runat="server" CssClass="form-control"></asp:TextBox>
                  <asp:HiddenField ID="CodPres" Value="{{: CodPres}}" runat="server" />
 
              </td>
          </tr>
 
 
      </table>
  </script>

That's work but I need change button text Save and Cancel, how I can do that?

 

3 Replies

AR Ajith R Syncfusion Team January 15, 2016 06:22 AM UTC

Hi Daniel,

Thanks for using Syncfusion products.

Query: I need change button text Save and Cancel, how I can do that?

We suggest you to change the SaveButton  and CancelButton properties in ej.Grid.Locale with corresponding culture and assign culture code to the Grid Locale API. Please refer the below code snippet for further details.


<script type="text/javascript">

        ej.Grid.Locale["es-ES"] = {

            SaveButton: "Ahorrar",

            CancelButton: "Cancelar"

        }
</script>

<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" Locale="es-ES">

        ---------

        ---------
</ej:Grid>


Note: We have to refer the corresponding culture script in the application to perform localization in the Grid.

Please refer the below UG and KB links for further details.

UG: http://help.syncfusion.com/js/grid/globalizationandlocalization

KB: https://www.syncfusion.com/kb/4008/how-to-enable-localization-in-grid

Please let us know if you have any concerns.

Regards,
Ajith R


OD Oscar Daniel Vega Castaneda February 16, 2016 04:06 PM UTC

Thank you!!! awesome!! thats resolve my issue!!


BS Balaji Sekar Syncfusion Team February 17, 2016 04:45 AM UTC

Hi Oscar, 

We are happy that the provided suggestion helped you. 
Please get back to us if you need any further assistance.  

Regards, 
Balaji S.

Loader.
Up arrow icon