aspnet-devexpress-dot-web-dot-aspxtextedit-bd7bdb32.md
Fires when the control accepts the new text value entered by a user.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public event EventHandler TextChanged
Public Event TextChanged As EventHandler
The TextChanged event's data class is EventArgs.
The control raises the TextChanged event after it accepts the text value entered by a user. To accept the new value, a user can press Enter, or defocus the text field (press Tab, or click another page area).
To allow the editor to raise the server-side TextChanged event, use one of the following options:
Set the AutoPostBack property to true.
In the client-side TextChanged event handler, set the processOnServer argument property to true. In this case, the editor raises the client-side event and then raises the server-side TextChanged event.
<dx:ASPxComboBox ID="ASPxComboBox1" runat="server" AutoPostBack="true" ClientInstanceName="combo"
OnTextChanged="ASPxComboBox1_TextChanged">
<Items>
<dx:ListEditItem Text="Item1" Value="1" />
<dx:ListEditItem Text="Item2" Value="2" />
</Items>
</dx:ASPxComboBox>
<dx:ASPxSpinEdit ID="ASPxSpinEdit1" runat="server" Number="0"
MinValue="0" MaxValue="1">
</dx:ASPxSpinEdit>
protected void ASPxComboBox1_TextChanged(object sender, EventArgs e) {
ASPxSpinEdit1.Value = ASPxComboBox1.SelectedIndex;
}
Protected Sub ASPxComboBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
ASPxSpinEdit1.Value = ASPxComboBox1.SelectedIndex
End Sub
TextChanged event fires before the client-side TextChanged event.The following code snippets (auto-collected from DevExpress Examples) contain references to the TextChanged event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
textBox.ValidationSettings.RegularExpression.ErrorText = UserVisibleExceptionLocalizer.GetExceptionMessage(UserVisibleExceptionId.MaskValidationErrorMessage);
textBox.TextChanged += EditValueChangedHandler;
return textBox;
lookupEdit.SelectionMode = GridLookupSelectionMode.Multiple;
lookupEdit.TextChanged += EditValueChangedHandler;
lookupEdit.KeyFieldName = LookupValueColumnName;
textBox.ValidationSettings.RegularExpression.ErrorText = UserVisibleExceptionLocalizer.GetExceptionMessage(UserVisibleExceptionId.MaskValidationErrorMessage)
AddHandler textBox.TextChanged, AddressOf EditValueChangedHandler
Return textBox
lookupEdit.SelectionMode = GridLookupSelectionMode.Multiple
AddHandler lookupEdit.TextChanged, AddressOf EditValueChangedHandler
lookupEdit.KeyFieldName = LookupValueColumnName
See Also