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

Binding Issue

Hello !
I created a XAML page and a corresponding ViewModel.
But the value stay at 0.
Here's my code

XAML : 
<numeric:SfNumericTextBox Grid.Column="1"
                                Value="{Binding NombrePlace, Mode=TwoWay, Converter={StaticResource StringToInteger}}"
                                MaximumNumberDecimalDigits="0"
                                AllowNull="True"
                                Watermark="Nombre de place"
                                HorizontalOptions="Fill"
                                FontSize="15"
                                Margin="0,0,0,5"/>

View Model :

public int NombrePlace
        {
            get { return _nombrePlace; }
            set { _nombrePlace = value; }
        }
        private int _nombrePlace;

Any one know where did i made a mistake ?
Thanks ! :)

1 Reply

PK Pavendhan Kumar Syncfusion Team July 11, 2016 11:58 AM UTC

Hi Yasahbi,

From the provided code example, we infer that you are trying to set Null value to the NumericTextBox and binding it to the int type property so it shows 0 initially. If your requirement is to display null textbox at the startup, then the property has to be nullable field. We have created a sample to display null element initially. Please download the sample from the below mentioned link.

Link: http: //www.syncfusion.com/downloads/support/forum/124910/ze/NumericTextBoxBinding-1052995621

If your requirement is different from the above, please provide us more information or modify the sample to reproduce your reported problem. It will be convenient for us to assist you further.

Regards,
Pavendhan K
 


Loader.
Live Chat Icon For mobile
Up arrow icon