Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Dynamically change WebCurrencyEdit culture
posted

Hi,

Is there any way (besides placing controls in UpdatePanel) to change WebCurrencyEdit culture on the client? I'd like to change culture based on user's choice from DropDownList without (visible) server rountrip. In fact i only need to display correct currency symbol in non-edit mode. Is there any way to achieve that?

 

Best Regards,

Peter R

 

 

Parents
No Data
Reply
  • 24497
    Suggested Answer
    posted

    Hi Peter,

    You may change symbol and other format properties on client. Below is example to change symbol on client.

    Note: You should keep in mind that persistance of those values is not supported and after a postback format will return to original server format.

    <script type="text/javascript">
    function changeSymbol()
    {
      var edit = igedit_getById('<%=WebCurrencyEdit1.ClientID%>');
      var val = edit.getValue();
      edit.symbol = '¥';
      //edit.positivePattern = 'n$';
      //edit.decimalSeparator = ',';
      //edit.groupSeparator = '.';
      edit.setValue(val);
    }
    </script>
    <input type="button" value="Change$" onclick="changeSymbol()" />
    <igtxt:WebCurrencyEdit ID="WebCurrencyEdit1" runat="server"></igtxt:WebCurrencyEdit>

Children