PropertyChange Iusse

Hello, I'm trying to use your SfNumericTextBox for my app, but I'm not able to make it work as I expected:

I bound the value whit a property, expecting that every time the user change a digit it will fire the event valuechanged and update the properyvalue, but it doesn't. I changed the property  ValueChangeMode, but It fire only when I press enter, or if the textbox loose focus, but I want the it fire also every time the value change. can it be done as for the standard xamarin forms entry? I'm on android and I'm not using MVVM.


4 Replies

AA Aarthi Arjunan Syncfusion Team September 16, 2024 06:32 AM UTC

Hi Halcyon Security,


We have reviewed your query and created a sample based on the provided details. However, we were unable to replicate the reported issue. In the SfNumericTextBox, the ValueChanged event triggers as expected each time a new value is added when the ValueChangeMode is set to OnKeyFocus.


To better assist you, could you please provide us with the Device details and  complete code or a sample demonstrating the issue with replication steps would be extremely helpful. This will enable us to thoroughly investigate and propose a more accurate solution.


For your convenience, we have included the tested sample and a demonstration video as an attachment. Please review the attached files and let us know if you have any concerns. If necessary, please make any required modifications and share the updated sample with us.


Please don’t hesitate to contact us if you have any queries.


Regards,

Aarthi A.


Attachment: Reference_7275af06.zip


AS Adrian Scott September 18, 2024 09:02 AM UTC

It seems that the SfNumericTextBox is not firing the ValueChanged event immediately as you'd like. This is likely due to the ValueChangeMode setting, which defaults to updating only on Enter key press or when the textbox loses focus.

To achieve the behavior you want—updating the property value on every change—you may need to handle the TextChanged event directly. Since you’re not using MVVM and are working on Android, you can subscribe to the TextChanged event of the SfNumericTextBox and manually update the property value in the event handler.


Here’s a basic example of how you might do this:

// Assuming your SfNumericTextBox is named numericTextBox

numericTextBox.TextChanged += (sender, e) =>

{

    // Update your property value here

    // For example:

    YourProperty = numericTextBox.Text;

};


If you need a more tailored solution or further assistance, consider consulting with a provider of custom mobile app development services. They can offer expertise to help resolve such issues and ensure your app functions as expected.

Hope this helps!



AA Aarthi Arjunan Syncfusion Team September 19, 2024 11:58 AM UTC

Hi Adrian Scott,

 

In your suggestion, the TextChanged event was recommended. However, the SfNumericTextBox control does not have a TextChanged event. Instead, you can implement the same logic within the ValueChanged event and set the ValueChangeMode property to OnKeyFocus. This way, the event will be triggered whenever input is entered.

Please feel free to reach out if you have any further questions or concerns.

Regards,

Aarthi A.



DS Dkeoc Skao February 17, 2025 01:44 PM UTC

It seems like the PropertyChange issue might be affecting the overall performance. When we consider the root causes, it could be beneficial to check the state management for any inconsistencies. In some cases, leveraging more reliable frameworks or libraries can help mitigate such issues. One useful reference for mobile development practices that could address this is https://www.cleveroad.com/services/mobile-development/.


Loader.
Up arrow icon