Hi,
I am using NetAdvantage for WPF and would like to add spin buttons, i.e. up and down buttons to a XamNumericEditor. How can I do that? Setting SpinWrap to true did not work.
For this, you would have to retemplate the editor (the EditTemplate) and put buttons (up/down) inside the ControlTemplate. You can see the default style in the DefaultStyles directory an use it as a base for your custom one.
Let me know if you have questions on this.
Any plan to add it as a control in netadvantage for wpf?
I have the same request and I want a control I can just drag and use.
ps
Currently I added extended wpf toolkit (community version) as the solution.
As you said, I added some control template like following:
<ControlTemplate x:Key="XamMaskedEditorControlTemplate1" TargetType="{x:Type igEditors:XamMaskedEditor}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="20"/> </Grid.ColumnDefinitions> <Border x:Name="MainBorder" BorderBrush="#FF00FF05" BorderThickness="2" Margin="1"> <TextBlock x:Name="TextBlock" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding DisplayText}"/> </Border> <Grid Margin="0" Grid.Column="1"> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Button Content="+" d:LayoutOverrides="Height"/> <Button Content="-" d:LayoutOverrides="Height" Grid.Row="1"/> </Grid> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEmbedded" Value="False"> <Setter Property="Padding" Value="4,2"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate>
and then apply this control template to the XamNumericEditor. At this time I got some problem.
When I focusing to the NumericEditor, this template is disappear in UI.
What's wrong in this code?