Problems with Numeric

The RadzenNumeric control uses a string parameter as the step size. If I try the samples in my machine, they don't work properly as the Step parameter has a dot but in my machine it expects a comma as decimal separator (es-ES culture). Why the Step parameter is not of type "TItem" ?

Also, it seems that the control size depends on the Step, Max an Min parameters. However, it does not work for my culture. If I specify a Step="0,001", Min=0 and Max=40 the control does not display all the digits. I need to specify a Step="0.001" for it to make the control wide enough. However, as my culture is es-ES, it increments the value in steps of one instead of 0.001 because of the problem described in the first paragraph.

And last but not least, that automatic sizing can be useful in a lot of scenarios, but it would be great if there is a parameter to turn it off in order to have consistency in width sizes between different RadzenNumeric components.

Blazor compiler cannot parse comma for such property type value:


I'm not sure about automatic sizing - can you elaborate? You do not have to specify width for the Numeric component or you can specify width: 100% if you want the component to be sized according to parent:
https://blazor.radzen.com/numeric

Vladimir. This is really strange. I'm getting the step as a string:

And I used a decompiler to see if there's a bug with VS2019 preview, but you can see it is a string in v1.2.5:

I’ve changed the property type to illustrate you what will happen if the type is TValue and you attempt to enter value with comma.

Yes, if the property type is TValue using a comma should give an error.
So, are you going to change the type from string to TValue?

If I change the type from string to TValue you will unable to set values with comma - I’m answering the question from your original post.

I tried using the Step with comma because using it with a dot didn't work for me. I'm fine setting the literal values with a dot if you change the type to TValue.

Hello!
How to prevent showing comma other than server's current culture in numeric updown?
Users can make input errors without knowing which separator is required, for example by entering:
code
The component converts this value without a separator:
code1
Also, I would like such input to the component to be impossible:
code2

I'll try to demonstrate my workaround.
So, we need to prevent input errors associated with the decimal delimeter. Suppose the server is in an area where the separator is a comma. We need to handle the dot input and cancel it.

Write the javascript function:

function PreventDotInput () {
     $ ('.ui-spinner-input').on('keydown', function (e) {
         if (e.key === '.') {
             e.preventDefault();
         }
     });
 };

Save it to the ElementsUtil.js file in the wwwroot/js folder
Include a script in _Hosts.cshtml

<script src = "/js/ElementsUtil.js" type = "text/javascript"></script>

For the RadzenNumeric component that needs to set this behavior, write:

<RadzenNumeric onclick = "PreventDotInput()">

That's it, now when receiving focus, this component will not output pressing dot.