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

Maximum and minimum values

hi is there anyway to add minimum and maximum value settings.

7 Replies

HM Hemalatha Marikumar Syncfusion Team June 21, 2016 12:07 PM UTC

Hi Safdar,

Thanks for contacting Syncfusion Support.

Currently we do not have direct support for minimum and maximum settings in SfNumericTextBox . We have created a workaround sample to achieve your requirement. Please download the same from the following link

Link: http://www.syncfusion.com/downloads/support/forum/124635/ze/NumericTextBox-439574455

Regards,
Hemalatha M.R


AT Atif June 22, 2016 03:40 AM UTC

Thanks alot.


HM Hemalatha Marikumar Syncfusion Team June 23, 2016 04:16 AM UTC

 Hi Safdar,

Thanks for your update.

Please let us know if you require any further assistance

Regards,
Hemalatha M.R 



PP Paul Parkins September 26, 2018 01:32 PM UTC

This sample is 2 years old and out of date for current versions of Syncfusion/Xamarin. It did not compile for me (11 errors, 10 warnings), even after removing the iOS and Window's projects that I cannot build due to my dev hardware availability. All issues are related to the references to Syncfusion components. Why would the Droid project even try to have a reference to Xamarin.iOS, I don't know?

I almost got it to compile by correcting the references to the versions of Syncfusion, but struggled with the re-implementation of BindableProperty.Create (which is now is obsolete since the original project was written)

So that's a bit of feedback on that sample project. So instead of seeing it work in practice, I chose to just study the code.
My questions are:
 - What is the point of the NumericRenderer class? It implements one overridden method, and does nothing in it other than call the base method. Also the class isn't even referred to any projects, so why is it even there?
 - Where is any validation against the new Minimum and Maximum properties being enforced? It seems to me you have added 2 new properties, which have no effect on the user value being entered.
 - Given this advice and sample is 2 years old, have there been any changes in Syncfusion since that would more easily allow for what the OP asked?

FYI,  I want to allow for entry of positive integer values (MaximumNumberDecimalDigits is 0), but currently it allows negatives, and numbers bigger than the largest allowable int value.


Thanks

Paul







PA Paul Anderson S Syncfusion Team September 27, 2018 11:40 AM UTC

Hi Paul, 
 
Greetings from Syncfusion. 
 
We have checked the sample, which is working fine except windows projects. We have updated the sample with the new versions 
 
Query 1: What is the point of the NumericRenderer class? It implements one overridden method, and does nothing in it other than call the base method. Also, the class isn't even referred to any projects, so why is it even there? 
NumericRenderer classes are not needed. Please ignore those classes and methods. We have removed those unwanted codes. Please find the sample from the below link. 
 
 
Query 2: Where is any validation against the new Minimum and Maximum properties being enforced? It seems to me you have added 2 new properties, which have no effect on the user value being entered. 
Validations against the new Minimum and Maximum properties are done in ValueChanged Event. 
 
Query 3: Given this advice and sample is 2 years old, have there been any changes in Syncfusion since that would more easily allow for what the OP asked? 
Currently, we don’t have Range support in SfNumericTextBox. Already we have feature request on this and it will be available in our upcoming volume release. 
 
Query 4: I want to allow for entry of positive integer values (MaximumNumberDecimalDigits is 0), but currently it allows negatives, and numbers bigger than the largest allowable int value. 
If we set Minimum value as zero, then it does not allow negative values. 
 
<local:NumericText x:Name="sfNumericTextBox" 
                   MaximumNumberDecimalDigits="0" 
                   HeightRequest="50" 
                   Minimum="0" 
                   Maximum="100" 
                   Value="52" 
                   AllowNull="false" 
                   FormatString="n"/> 
 
Regards, 
Paul Anderson 



GW Gerhard Wagner June 28, 2019 10:19 AM UTC

Hi in the actual version of the sfnumerictextbox there is the minimum and the maximum value.

I use binding in mode=twoway...

After entering a higher value to the gui than allowed I have 255 and enter 300 it corrects perfectly to 255 but the binding is not informed!
My sample:

<syncfusion:SfNumericTextBox x:Name="textBox" Value="{Binding Cycle, Mode=TwoWay}" FormatString="n" 
                                         MaximumNumberDecimalDigits="0" 
                                         Maximum="255" 
                                         Minimum="1" HorizontalOptions="CenterAndExpand" />

Am I doing something wrong, or is there a bug?

Thanks
Gerhard


RA Rachel A Syncfusion Team July 1, 2019 01:11 PM UTC

 
Thanks for contacting Syncfusion Support. 
 
We have prepared a sample with the provided code snippet and tried to reproduce the issue. But we are afraid that we are not able to reproduce this issue at our end. Please download the sample from the following location. 
 
 
[XAML] 
  
 <StackLayout Margin="0,40,0,0" Orientation="Vertical">
        <StackLayout.BindingContext>
            <local:ViewModel />
        </StackLayout.BindingContext>
        
        <numericTextBox:SfNumericTextBox x:Name="textBox" Value="{Binding Cycle, Mode=TwoWay}" FormatString="n" 
                                         MaximumNumberDecimalDigits="0" 
                                         Maximum="255" 
                                         WidthRequest="400"
                                         Minimum="1" HorizontalOptions="CenterAndExpand" />
        
        <Label Text="{Binding Source={x:Reference textBox}, Path= Value}" BackgroundColor="Gray" TextColor="Red"  />
        <Label Text="{Binding Cycle} " BackgroundColor="Gray" TextColor="Red" />
    </StackLayout>
 
  
  
[C#] 
public class ViewModel: INotifyPropertyChanged
    {
        public ViewModel()
        {
        }

        private double cycle = 0;

        public event PropertyChangedEventHandler PropertyChanged;

        public double Cycle
        {
            get { return cycle; }
            set
            {
                cycle = value;
                RaisePropertyChanged("Cycle");
            }
        }

        void RaisePropertyChanged(string name)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            }
        }
    }
 
  
 
Since we are not aware of your exact application scenario, we were not able to reproduce this issue at our end, so can you please revert us by modifying the sample based on your application along with replication procedure. This will be helpful for us to investigate further and provide you a better solution at the earliest.  
 
Regards, 
Rachel. 


Loader.
Live Chat Icon For mobile
Up arrow icon