Globalization and culture settings

Posted by: jkainth on 16 November 2018, 3:29 am EST

  • Posted 16 November 2018, 3:29 am EST

    For a grid with numbers, displaying and editing. How can i make spread views respect/change the culture settings.

    In spread.sheets we could set the CultureInfo (decimal seperator, group seperator etc), which would make format strings and editing work correctly (so i can use correct decimal seperators).

    How can i do the above in spread.views without having to:
    - override the format string with custom fomatter functions
    - create custom number cell editors that respect culture
  • Replied 18 November 2018, 7:37 pm EST

    Hello,

    We have escalated your request to our concerned team for further investigation. We will get back to you as soon as we hear anything from them.

    Tracking id for your issue is #267402

    Thanks,
    Reeva
  • Replied 19 November 2018, 3:17 pm EST

    Hello,

    According to developers, Spread.Views and Spread.Sheets share the same formatter, you can set the culture via the static method from CultureManager like GC.Spread.Common.CultureManager.culture("ja-jp") to change the entire control culture.

    Hope it helps.

    Thanks,
    Reeva
  • Replied 20 November 2018, 7:43 am EST

    thanks ill give it a try
  • Replied 20 November 2018, 8:41 am EST

    Hey,
    So just confirmed that setting the culture is respected with the format strings.

    But when you edit - the editing input is of type number; which defaults the the browser locale and ignores the decimal seperator specified in the culture.
    In spread sheets the editor is usually textarea or a text input type and seems like it does the right thing

    What are my options with views?
    - custom editor? or is there another way around this?
  • Marked as Answer

    Replied 25 November 2018, 2:29 pm EST

    Hello,

    According to our developers, we don't respect the culture in editing and here is the workaround for the same. You can add handler to editing event as given below:-

    dataView.editing.addHandler(function(sender, args) {
    var status = args.status;
    if (args.status === "beforeEndEditing" ) {
    //get the value from the args.newItem
    //parse the data with culture
    //set it back to args.newItem
    }
    });

    Hope it helps.

    Thanks,
    Reeva
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels