This question is locked. New answers and comments are not allowed.
Is it possible to right align the numeric value in the Numeric Box control?
I did try these, but seem to have no affect;
I did try these, but seem to have no affect;
numericBoxPicker.HorizontalContentAlignment = HorizontalAlignment.Right;
numericBoxPicker.HorizontalAlignment = HorizontalAlignment.Right;
4 Answers, 1 is accepted
0
Hi Bevan,
I hope this helps and do not hesitate to contact us if you have any other questions or ideas. Regards,
Rositsa Topchiyska
Telerik
Thank you for your question.
To change the properties that define the appearance of the text box part of the RadNumericBox control, you have to define an implicit style that targets the NumericTextBox class (defined in the Telerik.UI.Xaml.Controls.Input.NumericBox namespace) in the resources of the control:
<telerikInput:RadNumericBox> <telerikInput:RadNumericBox.Resources> <Style TargetType="telerikNumericBox:NumericTextBox"> <Setter Property="TextAlignment" Value="Right"/> </Style> </telerikInput:RadNumericBox.Resources></telerikInput:RadNumericBox>I hope this helps and do not hesitate to contact us if you have any other questions or ideas. Regards,
Rositsa Topchiyska
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Bevan
Top achievements
Rank 1
answered on 30 Aug 2013, 05:12 PM
Thanks, I'll give this a try, but can it also be done in C# codebehind?
0
Hi Bevan,
Where:
I hope this was useful. Let us know if there is anything else we can assist you with.
Regards,
Rositsa Topchiyska
Telerik
This is how you can define an implicit style in code behind:
Style numericTextBoxStyle = new Style();numericTextBoxStyle.TargetType = typeof(NumericTextBox);numericTextBoxStyle.Setters.Add(new Setter() { Property = NumericTextBox.TextAlignmentProperty, Value = TextAlignment.Right });numericBox.Resources.Add(typeof(NumericTextBox), numericTextBoxStyle);<telerikInput:RadNumericBox x:Name="numericBox"/>I hope this was useful. Let us know if there is anything else we can assist you with.
Regards,
Rositsa Topchiyska
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
<telerikInput:RadNumericBox x:Name="numericBox"/>
<telerikInput:RadNumericBox x:Name="numericBox"/>
0
Bevan
Top achievements
Rank 1
answered on 04 Sep 2013, 07:14 PM
Thanks that worked for the alignment issue.