Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
Regarding XamNumericEditor format hide and show
posted

Hi

I have used XamNumericEditor and XamCurrencyEditor to display values in particular format like "Format=.000000"

Initially the format of value should not be displayed when we open the window.

After that,when the textbox is focused then it should display the format of value in the textbox.

Please find the attached file for clear picture.

File1.zip
Parents
No Data
Reply
  • 12875
    posted

    Hi Saravanan, 

    I used your xaml and made a few changes.  I think I ended up with what you want.  I also add a xamNumericEditor for the Quantity property. You should include a ValueType reference there if your data is not of the default Double type. 

    <TextBlock Text="Contract Value:" Grid.Row="0" Grid.Column="0"

                       HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3,0,0,0"></TextBlock>

            <igWPF:XamCurrencyEditor  Grid.Row="0" Grid.Column="1" Width="120"

                                      HorizontalAlignment="Left"  VerticalAlignment="Center"

                                      Margin="5,3,0,3"                                  

                                      Mask="{}{double:-15.3}" Format="##,###,###.###"                                  

                                      DisplayMode="Raw"  DataMode="Raw"                               

                                      HorizontalContentAlignment="Right"                                    

                                      Text="{Binding ContractValue}"

                                      IsEnabled="{Binding IsContractValueEnable}"/>      

            <TextBlock Text="Quantity:" Grid.Row="1" Grid.Column="0" Margin="3,0,0,0"

                       HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>

            <igWPF:XamNumericEditor Grid.Row="1"  Grid.Column="1"  Width="80"

                                    HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,3,0,3"                               

                                    InvalidValueBehavior="RevertValue"                               

                                    PromptChar=""

                                    HorizontalContentAlignment="Right"                               

                                    Text="{Binding Quantity}"

                                    ValueType="{x:Type sys:Int16}"

                                    Mask="###" Format="###"   >           

            </igWPF:XamNumericEditor>       

            <TextBlock Text="Premium Rate:" Grid.Row="2" Grid.Column="0" Margin="3,0,0,0"

                       HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>

            <igWPF:XamNumericEditor  Grid.Row="2" Grid.Column="1"  Width="80"

                                    HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,3,0,3"                                

                                    Mask="{}{double:-2.6}" Format=" %"                                 

                                    DisplayMode="IncludeLiteralsWithPadding" DataMode="Raw"

                                    HorizontalContentAlignment="Right"                                 

                                    InvalidValueBehavior="RevertValue"                               

                                    PromptChar=""              

                                    Text="{Binding PremiumRate}"

                                    IsEnabled="{Binding IsPremiumRateEnable}"

                                    TabIndex="70">

                <!--  I removed your reference to the SpinIncrement

                            SpinIncrement="0"             

                -->

                <igWPF:XamNumericEditor.ValueConstraint>

                    <igWPF:ValueConstraint Nullable="False"/>

                </igWPF:XamNumericEditor.ValueConstraint>

            </igWPF:XamNumericEditor> 

    Let me know if this helps.

     

Children