When value of a bound ultratexteditor is edited by the user I need its value to be copied to another bound ultratexteditor on the same form. How can I achieve this?
I have tried using valuechangd and textchanged events but they get fired even when user moves to a new record and not just when ultratexteditor value is changed. How can I differentiate between a texteditor values changed by the user and text editor value changed due to moving to a new record?
Since there are more than one fields that need this and focus can't be on all of them, after some tinkering, I have used the below code for each field that needs it;
Private Sub txtMyField_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMyField.ValueChanged If DirectCast(sender, Infragistics.Win.UltraWinEditors.UltraTextEditor).Modified = True Then txtMyField2.Text = txtMyField.Text End If End Sub
Seems to have worked so far.
yahya01 said:get fired even when user moves to a new record and not just when ultratexteditor value is changed. How can I differentiate between a texteditor values changed by the user and text editor value changed due to moving to a new record?
Assuming that the user can only navigate to a different record via the user interface, you can handle ValueChanged or TextChanged, and add a conditional to your logic so that you only copy the value over when the first editor has the input focus (i.e., the ContainsFocus property returns true).