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
200
Editor parses bad value in rowedittemplate
posted

Hi,

I've got a problem with webnumericeditor

I use it in a rowedittemplate and it is bound to a datafield of type Long (or whatever)

If the value is for instance "45,37" the set_value will be 4537, so the webnumericeditor will top to the max value (which is 100 in my case)

When you enter a value like "31,74" in the webnumericeditor and commit, the correct value is passed to the code behind

I had many tentatives with culture and even replaced it by a webmaskeditor, but I always have this problem of initial parsing during the set_value, for which the {value} parameter has no more comma

Could someone direct me to a solution please?

Many thanks!

Parents
  • 37874
    posted

    Hi Antoine,

    Thank you for posting in our forum.

    I could suggest you a possible workaround - set EnableScriptGlobalization property of the ScriptManager to true, and if then a point appears in the editor, instead of a comma, you could replace it in the TemplateOpened client-side event, for example:

    function onTemplateOpened(sender, args) {
        var newVal = document.getElementById('WebDataGrid1_ret_WebNumericEditor1').value.replace('.', ',');
        document.getElementById('WebDataGrid1_ret_WebNumericEditor1').value = newVal;
    }

    Also, you should set the same culture for your page and the WebNumericEditor.

    I am attaching a small sample for your reference.

    As I'm still looking into this, I will update you as soon as I have more information.

    RowEditingNumericEditor.zip
Reply Children
No Data