Hi,
I'm new to Infragistics and trying to use XamNumericEditor in a touch based UI where I want the Up Down SpinButtons to be bigger in size to make it better in usability.
Could you please suggest a way to do it?
Thanks,
Rituraj
Hello Rituraj, In order to manipulate the size of the spin buttons inside of the XamNumericEditor, an approach I can suggest you is to set the SpinButtonStyle of the editor by creating a Style that is targeting the RepeatButton class. This way you should be able to directly set it's Width or Height properties. For Example: <igEditors:XamNumericEditor.SpinButtonStyle> <Style TargetType="RepeatButton"> <Setter Property="Width" Value="50" /> </Style></igEditors:XamNumericEditor.SpinButtonStyle> I have also prepared a sample application where this behavior has been implemented. If you require any further assistance on this matter, please do not hesitate to ask.
Hello Tacho
Thanks for the quick response. This works. I'm now trying to change other properties of the buttons like replacing the Up/Down Arrow with '+' and '-' respectively and removing the underline in the text box during edit.
Any quick help would be appreciated.
Many thanks,
Hello Rituraj, In order to change the default content inside the RepeatButtons, I can suggest you to either get the necessary default styles and retemplate the control directly or to override the EditorBrushKeys Resources. The default styles for the editor should be in a similar to the following directory: C:\Program Files (x86)\Infragistics\2016.1\WPF\DefaultStyles\Editors\ EditorsGeneric.xaml.
1) Overriding the EditorBrushKeys in order to set a "+" and "-" symbols respectively could be created both by drawing it with a Path instance or by a simple TextBlock. <Grid.Resources> <DataTemplate x:Key="{x:Static igEditors:EditorsBrushKeys.IncreaseGlyphKey}"> <TextBlock Text="+" FontSize="15" /> </DataTemplate> <DataTemplate x:Key="{x:Static igEditors:EditorsBrushKeys.DecreaseGlyphKey}"> <TextBlock Text="-" FontSize="15" /> </DataTemplate></Grid.Resources> 2) In order to disable the visualization of the PromptChar (a character with a default value of '_', that acts as a placeholder for the digits of the editor), you can set the PromptChar property of the editor as follows: <igEditors:XamNumericEditor x:Name="numEditor" Width="200" Height="50" PromptChar="" SpinButtonDisplayMode="Always" VerticalContentAlignment="Center" /> I have modified the application from my previous post with the new behavior, along with the commented default styles, which you should be able to also use for retemplating. (refer to App.xaml) If you require any further assistance on the matter, please let me know.