Problem retrieving value from a NumericTextBox

Hello, 
I have defined a NumericTextBox with this code:

<xForms:SfNumericTextBox x:Name="precio"
                                             HorizontalOptions="FillAndExpand"
                                             TextColor="Chartreuse"
                                             FontSize="22"
                                             FontFamily="{StaticResource FuenteNormal}"
                                             FormatString="c" 
                                             BackgroundColor="Black"
                                             MaximumNumberDecimalDigits="2"
                                             Maximum="999"
                                             WatermarkColor="Chartreuse"
                                             IsEnabled="True"/>

...and i want to read its value to be able to save it and update a listview...

The code to update values:

public void GrabarButton_OnClicked(object sender, EventArgs e)
        {

            var vEmployee = new Employee()
            {
                EmpName = nombreComboBox.Text,
                Company = marcaComboBox.Text,
                Department = articulosComboBox.Text,
                Designation = familiaComboBox.Text,
                Qualification = packComboBox.Text,
                Precio = (int)precio.Value
        };

            
            App.DAUtil.SaveEmployee(vEmployee);
            Navigation.PushAsync(new CatalogoArticulos());


...but with the code Precio = (int)precio.Value, don´t save anyting...without this line, saves all (all, but without Precio)

Variable Precio is defined as int, the other variables are defined as string and works well, but i can´t make it work including Precio...
What am i doing wrong? How can i read the value of NumericTextBox?
Thanks in advance




1 Reply

AS Anandraj Selvam Syncfusion Team May 27, 2020 10:30 AM UTC

Hi Luis Gomez, 
  
Greetings from the Syncfusion. 
  
We have checked the reported query and we suggest you to convert to int as below code snippet: 
  
Code Snippet: 
  
Precio = Convert.ToInt32(precio.Value.ToString()) 
  
  
Please go through the below link for more details 
  
  
Please revert us for further investigation. 
  
Regards, 
Anand Raj S. 


Loader.
Up arrow icon