Hello,
I would like to have cells that allow a user to enter decimal values, and prohibit characters other than numbers and the decimal separator. The NumericUpDown control is very uncomfortable, so I use this column:
public abstract class NumericColumn : DataGridViewTextBoxColumn { public NumericColumn() { InputType.Type = TextBoxType.Number; // ... other stuff ... } }
This meets perfectly my needs, expect for the up an down arrows that come with the HTML Input Type being rendered. I want to get rid of these arrows.
How can I proceed ?
Thank you very much. By the way, I really like working with WiseJ a lot, it really deserves to be known.
Hi Laurent
Good news!!
A colleague gave me some tips to be able to hide the arrows in the number cell.
These are
1) Use CSS to hide the arrows. Add this to Default.html in a style tag:
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
2) Set InputType.Type to Text, InputType.Mode to Numeric (shows numeric soft keyboard on iOS and Android, no input filtering), and apply a RegEx filter (Filter property).
3) Use a MaskedTextBox with InputType.Mode = “Number” and a custom mask: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.maskedtextbox.mask?view=net-5.0#system-windows-forms-maskedtextbox-mask
I attached a sample that covers the number 1
Regards and happy coding
Hi Laurent
Unfortunately, these type checks for InputType and all related settings are entirely native and managed by the browser
Our development team will considere this as an enhancement in future release.
Thanks and happy coding
Hi Laurent
Thank for write us
What version of Wisej are you working?
Regards
Please login first to submit.