This question is locked. New answers and comments are not allowed.
I am trying to set the default input of the Numeric Box to be the Number keyboard. I tried the code below, which is similar to how we do it for regular text boxes, but it does not work. Any ideas?
Actually shouldn't this really be the default for your control anyway, since its numeric?
Style numericTextBoxStyle = new Style();
numericTextBoxStyle.TargetType = typeof(NumericTextBox);
numericTextBoxStyle.Setters.Add(new Setter() { Property = NumericTextBox.InputScopeProperty, Value = new InputScope { Names = { new InputScopeName() { NameValue = InputScopeNameValue.Number } } } });
numericBoxPicker.Resources.Add(typeof(NumericTextBox), numericTextBoxStyle);
Thanks
Simon
10 Answers, 1 is accepted
0
Hi Simon,
I must admit that your suggestion makes perfect sense and I have logged it as a feature request.
I am not sure why setting the NumericTextBox.InputScope through a style that is defined in code behind does not work, but we will further investigate what is the reason. However, if you set it through XAML, it will work as expected.
Another approach is to change the control template of the RadNumericBox and change the NumericTextBox.InputScope to Number. I have attached a project that demonstrates how to achieve this.
Ivaylo Gergov
Telerik
I must admit that your suggestion makes perfect sense and I have logged it as a feature request.
I am not sure why setting the NumericTextBox.InputScope through a style that is defined in code behind does not work, but we will further investigate what is the reason. However, if you set it through XAML, it will work as expected.
<
telerikInput:RadNumericBox.Resources
>
<
Style
TargetType
=
"localNumericBox:NumericTextBox"
>
<
Setter
Property
=
"InputScope"
Value
=
"Number"
/>
</
Style
>
</
telerikInput:RadNumericBox.Resources
>
Another approach is to change the control template of the RadNumericBox and change the NumericTextBox.InputScope to Number. I have attached a project that demonstrates how to achieve this.
I hope this helps. Let me know if I can assist you in some other way. I have also updated your Telerik points as a token of gratitude for the valuable feedback.
Regards,Ivaylo Gergov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Simon
Top achievements
Rank 1
answered on 06 Sep 2013, 03:36 PM
Thanks very much for the suggestions. I did try some of these, but unfortunately the way our application works is all our data input fields are derived from configuration. The ui controls are created dynamically during run time from this configuration and many of the properties of these controls are set on a case by case basis to enforce proper data validation. Even some property styles differ depending on configuarion for each field. This means it all has to be done in codebehind, including setting the style for the numeric text box.
I will have to wait for a new release which defaults to the number input keyboard or allows the InputScopeProperty to be set in code behind.
Thanks
Simon
I will have to wait for a new release which defaults to the number input keyboard or allows the InputScopeProperty to be set in code behind.
Thanks
Simon
0
Hi Simon,
If I understand you correctly, what you need is to create RadNumericBoxes with different configurations in code behind, but the InputScope will be always set to Number. If this is the case, I would like to suggest you create a UserControl that represents a RadNumericBox and change its control template. I have attached a project that shows how to achieve this.
Also, we will try to include this feature in our Q3 2013 Beta release(that will be available at the end of the month) and if we do not - it will be included in our Q3 2013 official release(around mid-October).
I hope this is useful.
Ivaylo Gergov
Telerik
If I understand you correctly, what you need is to create RadNumericBoxes with different configurations in code behind, but the InputScope will be always set to Number. If this is the case, I would like to suggest you create a UserControl that represents a RadNumericBox and change its control template. I have attached a project that shows how to achieve this.
Also, we will try to include this feature in our Q3 2013 Beta release(that will be available at the end of the month) and if we do not - it will be included in our Q3 2013 official release(around mid-October).
I hope this is useful.
Regards,
Ivaylo Gergov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Simon
Top achievements
Rank 1
answered on 22 Nov 2013, 04:43 PM
This claims to have been fixed (see below) so that the numeric box defaults to the number keyboard. Unfortunately it doesn't seem to be working for me, I still get the alpha keyboard. I am on the latest Q3 SP1 version 2013.3.1105 on Win 8.1, so I would assume it should work. I also tested in your XAML Controls Example App and it seems to be mostly defaulting to the alpha keyboard there as well, so I don't think it is just my code. In the sample on occasion I do get a number keyboard for the first (Red) Numeric box in the first numeric sample and the US currenmcy in the 2nd sample, but this sometimes disappears as well and goes back to alpha. All other numeric boxes in the sampe,m default to alpha keyboard. I also looked at the sample code and don't see anything different in the numeric boxes as to why this would work for one but not others, it may be some other property or binding affects it.
http://www.telerik.com/products/windows-8/whats-new/release-history/q3-2013-beta-version-2013-3-1001.aspx
http://www.telerik.com/products/windows-8/whats-new/release-history/q3-2013-beta-version-2013-3-1001.aspx
NumericBox XAML
NEW
- Added: Changed the default NumericTextBox.InputScope to Number.
0
Hello Simon,
I was able to reproduce this behavior and we will further investigate what causes it. I will contact you as soon as we have more information.
I have updated your Telerik points as a token of gratitude for the valuable feedback.
Regards,
Ivaylo Gergov
Telerik
I was able to reproduce this behavior and we will further investigate what causes it. I will contact you as soon as we have more information.
I have updated your Telerik points as a token of gratitude for the valuable feedback.
Regards,
Ivaylo Gergov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Simon
Top achievements
Rank 1
answered on 18 Dec 2013, 06:46 PM
Was this issue ever fixed, or it will be in the next SP?
Thanks
Simon
Thanks
Simon
0
Hi Simon,
This issue will be fixed in our next release(Service Pack). For now, the only workaround is to set different instances of Style(that sets the InputScope property to Numeric) for each RadNumericBox.
Regards,
Ivaylo Gergov
Telerik
This issue will be fixed in our next release(Service Pack). For now, the only workaround is to set different instances of Style(that sets the InputScope property to Numeric) for each RadNumericBox.
Regards,
Ivaylo Gergov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Tim
Top achievements
Rank 1
answered on 18 Jul 2014, 02:43 PM
I'm using the trial of the Win 8 UI controls. I'm having a problem where I can't set the InputScope on the RadNumericBox using the suggested route above. Here is my XAML. The alpha keyboard still comes up. Any suggestions? (Additionally, it won't respect the width setting, either.)
<
telerik:RadNumericBox
Grid.Column
=
"2"
Name
=
"Qty"
Value
=
"{Binding QtyEntered, Mode=OneWay}"
ValueFormat
=
"{}{0,0:0}"
>
<
telerik:RadNumericBox.Resources
>
<
Style
TargetType
=
"telerik:RadNumericBox"
>
<
Setter
Property
=
"InputScope"
Value
=
"Number"
/>
<
Setter
Property
=
"Width"
Value
=
"50"
/>
</
Style
>
</
telerik:RadNumericBox.Resources
>
</
telerik:RadNumericBox
>
0

Tim
Top achievements
Rank 1
answered on 18 Jul 2014, 03:35 PM
Update - I think I just found out that running the app in the simulator doesn't respect the InputScope type of number. As soon as I deploy to a physical Win 8 device, it works fine. (However, the width setting is still a problem, so I'll post about that separately.)
0
Hi Tim,
By default the RadNumericBox.MinWidth is 180, so should change it aswell.
Let me know if you need further assistance.
Regards,
Ivaylo Gergov
Telerik
By default the RadNumericBox.MinWidth is 180, so should change it aswell.
Let me know if you need further assistance.
Regards,
Ivaylo Gergov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.