I am missing in my code but hope to get some signal.
I have a text box, an object property that has an item in the list, and if it requests another item in the list, then that value is not updated on the form.
The following example To illustrate with:
txtGain value is populated after openJSONRequestFileToolStripMenuItem_Click fuction - Once I select something different in the cmbSignals combobox, I hope that the txtGain value is also updated as the selected channel since the update Education is, which updates selected index return, but it is not.
Actually I want to update my txtGain values based on the cmbSignals I select. Obviously binding is there so that I can modify the value in the text box and bind it in the property.
I suspect that I have to be forced to update the dam somehow, but it is not sure how to do this. Any help would be appreciated.
Public Partial Group MainForm: Form {Private MyData req; Public mainstream () {Initial group (); CmbSignals.DisplayMember = "name"; CmbSignals.ValueMember = "value"; } Private Zero openJSONRequestFileToolStripMenuItem_Click (Object Sender, EventArgs e) {string text = File.ReadAllText ("sample.json"); Reich = New Myadata (Jason's dialogue. Dialerial object & lt; serialized request & gt; (text)); CmbSignals.DataSource = req.SignalNames; CmbSignals.SelectedValue = req.SelectedChannel; SetBindings (); } Private Zero SetBinding () {txtGain.DataBindings.Add (new binding ("text", request, "profit")); } Private Zero cmbSignalsSelectedValueChanged (Object Sender, EventArgs e) {req.SelectedChannel = Convert.ToInt32 (cmbSignals.SelectedValue); }} Public class MyData: INotifyPropertyChanged {Private SerializedRequest data = New SerializedRequest (); Private Inch Selected Index = 0; Public Ink Selected Channels {{Selected Selected Index + 1; } Set {this.selectedIndex = value - 1; }} Public String Benefit {Receive} {Datacinals [selected index]. } Set {Data.signals [selectedIndex] .gain = value; OnPropertyChanged ("Benefits"); }} Private Event PropertyChangedEventHandler PropertyChanged; Protected Zero OnPropertyChanged (string name) {PropertyChangedEventHandler handler = property changed; If (handler! = Null) {handler (new, new property change event event (name)); }} Public listing & lt; SignalSimbitime & gt; Signal name {find} {list & lt; Signalsmicmatum & gt; Channel = new list & lt; SignalSimbitime & gt; (); (Int i = 0; i & lt; Data.signals.Count; i ++) {channels.Add (new signalsm {{value = i + 1, name = i + 1 + "-" + Data.signals [ I] .label}); } Return channel; }}}}
Beautiful troubled "feature", right?
But to get around it, after changing the value of req.SelectedChannel, your
. cmbSignals_SelectedValueChanged (Sender, e)
method is within one Add line of code
txtGain.BindingContext = new binding stamps ();
Comments
Post a Comment