Allownull=true does not work by the binded items

Hello everyone, 


I have tried to use AllowNull property but it works not as expected (at least not always)

I created a small project to show it,


My question is, does it work properly (not the same way for DataBindings/Usual uses)?

It is not possible to delete a value and set it to empty for the binded items.




Attachment: WinFormsApp2_3b24f101.zip

10 Replies

NO Norz July 26, 2022 08:26 PM UTC

small update, for the Data-String fields it works...


but in my example it is "double?"



BA BagavathiPerumal Apranandham Syncfusion Team July 27, 2022 11:46 AM UTC

Hi Norz,


We suggest you to use the Value property instead of the Text property to bind the value to SfNumericTextBox to accept null value when the AllowNull property is true.


Code Snippets:

sfNumericTextBox1.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bindingSource1, "A", true));


Regards,
Bagavathi Perumal A



NO Norz July 27, 2022 07:34 PM UTC

Hello Bagavathi,


thank you for the answer. I have tried it but some strange side effect still there. Please check an attachment.


You can see 4 fields (A, B, C, D but only B, C, D are binded to the appropriate fields).


The click on the button will show the current values in the data fields (class " Record ")


The changes for the field D (binded to the TEXT property) works as expected. The data field D changed by the button click. ... The fields B, C don't update the data fields.

SideEffect.jpg



Attachment: WinFormsApp2_6dd7f88a.zip


BA BagavathiPerumal Apranandham Syncfusion Team July 28, 2022 03:09 PM UTC

Hi Norz,



We are validating your reported query. We will validate and update you in two business days. We appreciate your patience until then.



Regards,
Bagavathi Perumal A



GT Gokul Thanudhas Syncfusion Team August 2, 2022 12:44 PM UTC

Hi Norz,


We have confirmed the reported scenario is a defect and logged a report for the reported scenario “Binding Value property of SfNumericTextBox is not working”. We will provide the patch for the reported issue on 23rd August 2022. 


You can track the status of this defect using the following feedback link:       

Binding Value property of SfNumericTextBox is not working in WinForms | Feedback Portal (syncfusion.com)


If you have any more specification replication procedures or a scenario to be tested, you can add it as a comment in the portal.

    

Please let us know if you need any further assistance.



Regards,

Gokul T




NO Norz replied to Gokul Thanudhas August 2, 2022 03:46 PM UTC

Dear Gokul,


thank you for the answer. Could you please check the same issue with

"SfDateTimeEdit" ?


Please check the atatched project to see the issue.


1. After start, all is OK

2. The values B, C changed but the binded class shows old values....



Attachment: BindingValueIssue_d8f5b18f.zip



BA BagavathiPerumal Apranandham Syncfusion Team August 3, 2022 02:42 PM UTC

Hi Norz,


We have confirmed the reported scenario is a defect and logged a report for the reported scenario “Binding Value property of SfDateTimeEdit is not working”. We will provide the patch for the reported issue on 23rd August 2022.


You can track the status of this defect using the following feedback link: Binding Value property of SfDateTimeEdit is not working in WinForms | Feedback Portal (syncfusion.com)


If you have any more specification replication procedures or a scenario to be tested, you can add it as a comment in the portal.


Please let us know if you need any further assistance.


Regards,
Bagavathi Perumal A



BA BagavathiPerumal Apranandham Syncfusion Team August 23, 2022 01:07 PM UTC

Hi Norz,


Sorry for inconvenience,

We are still working this issue with high priority and trying to find the route cause for this issue. We will update you the fix in our upcoming NuGet release which is scheduled on 30th August 2022.

We appreciate your patience until then.


Regards,
Bagavathi Perumal A




GT Gokul Thanudhas Syncfusion Team August 30, 2022 05:30 PM UTC

Hi Norz,


Sorry for the inconvenience caused.


We have found the cause for the binding issue. The cause of the issue is when using Name with its NameChanged event(example Value and ValueChanged event). The issue seems to be a framework issue. We have posted this in MSDN and StackOverflow forum. Please refer to the below forum links.


Binding is not working for the custom control Winforms - Microsoft Q&A


c# - Binding is not working for the custom control Winforms - Stack Overflow


We will update you once we got the solution.

Regards,

Gokul T.







GT Gokul Thanudhas Syncfusion Team September 19, 2022 05:45 AM UTC

Hi Norz,


On further analyses we have found when using Custom Delegate for the ValueChanged event, the binding is not working properly. If we have used EventHandler delegate for the event it is working fine. We have reported this issue to microsoft, we will wait until we get a response.


Please find the details form the below link


Regards,

Gokul T


Loader.
Up arrow icon