We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FormatString Dynamic Resource binding

I want to have format string dynamicly bound in a listview datatemplate based on settings like below, kg or lbs but binding doesnt work

     if (User.UnitSystem== "Metric")
                    WeightFormat = " kg";
                    WeightFormat = " lbs";

 //var WeightStyle = new Style(typeof(SfNumericUpDown))
            //    Setters = {
            //    new Setter { Property = SfNumericUpDown.HorizontalOptionsProperty, Value = LayoutOptions.FillAndExpand},
            //    new Setter { Property = SfNumericUpDown.VerticalOptionsProperty, Value = LayoutOptions.FillAndExpand},
            //    new Setter { Property = SfNumericUpDown.TextAlignmentProperty, Value = LayoutOptions.Center},
            //new Setter { Property = SfNumericUpDown.TextColorProperty, Value = Color.Black},
            //    new Setter { Property = SfNumericUpDown.ParsingModeProperty,  Value=ParsingMode.Decimal},
            //     new Setter { Property = SfNumericUpDown.FormatStringProperty,  Value= WeightFormat},
            //   new Setter { Property = SfNumericUpDown.CultureProperty,  Value=Helpers.Settings.CurrentCultureInfo},
            //    }

            //this.Resources["NumericStyle"] = NumericStyle;

          <numeric:SfNumericUpDown MaximumDecimalDigits="2"   Style="{DynamicResource NumericStyle}" 
                                                             x:Name="weightNumericUpDown"  Maximum="100000"  
                             Value="0"   >   

1 Reply

VA Vanaja  Annasamy Syncfusion Team July 27, 2017 03:58 PM UTC

Hi Emil,

Thank you for contacting Syncfusion support.

We were unable to reproduce the reported issue "FormatString is not changing dynamically when binding" in SfNumericUpDown. We have provided the sample for your reference. Please download the same from below link.

Link:  http://www.syncfusion.com/downloads/support/forum/131780/ze/NumericUp-797769829 

Please run the sample and check whether issue reproduces at your end. If not please modify the changes in the given sample and revert the error reproducing sample and this will help us replicate the issue at our end.

Vanaja R.A.

Live Chat Icon For mobile
Up arrow icon