BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
Hello,
I created my own control based on SfButton -> MyNumericButton.
When I click on this button at runtime its value changing to 7.7 (example), but the datasource is not updated when I setup a data binding. The data binding has no effect (I use INotifyPropertyChanged too).
I attach a sample project:
myNumericButton1.DataBindings.Clear();
myNumericButton1.DataBindings.Add("TextValue", MyModel2, nameof(MyModel2.SablonSzerkesztesIdoGepiButton), true, DataSourceUpdateMode.OnPropertyChanged);
I attach my sample to show this behavior.
Thank you very much for help!
BR, SZL
Hello,
I find the soultion based on this post:
https://www.syncfusion.com/forums/177874/databinding-not-working-with-this-control
Do you have information about the fix in the future?
Thank you!
BR, SZL
Hi SZL,
The reported issue is not from our control side. We have faced a similar issue from our side and reported to Microsoft team regarding this. Please find the details in the below link.
We have modified the sample based on your requirement, in which we have changed the CustomDelegate to Eventhandler Delegate. Please refer to the attached sample for your reference.
Regards,
Gokul T
Hi,
Thank you very much!
I can work with these workarounds now.
BR, SZL
We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out.
Hello,
I try use this workaroung with combobox control, but unfortunatelly in this case its not working. My combobox code:
public partial class MyComboBox : SfComboBox
{
public bool IsAnythingSelected { get { return this.SelectedItem != null && this.SelectedItem != DBNull.Value; } }
public MyComboBox()
{
this.SelectedValueChanged += MyComboBox_SelectedIndexChanged; ;
InitializeComponent();
}
private void MyComboBox_SelectedIndexChanged(object? sender, EventArgs e)
{
if (!SelectedItemBindableDuringSet)
{
selectedItemBindable = SelectedItem;
}
}
#region Fix binding bug
private object selectedItemBindable;
private bool SelectedItemBindableDuringSet = false;
public object SelectedItemBindable
{
get { return selectedItemBindable; }
set
{
selectedItemBindable = value;
if (this.SelectedItem != value)
{
SelectedItemBindableDuringSet = true;
this.SelectedItem = value;
SelectedItemBindableDuringSet = false;
}
}
}
#endregion
}
Can you help me please, why not working with combobox?
Thank you!
BR, SZL