简体   繁体   中英

Text changed event of text box in a gridview

I am new in wpf, so i have a problem in my gridview.

I'm using a TextBox in the GridView . Basically, what I want to do is call a method every time the text in the box is edited. That is when the text is entered, the function will call. That is the text change event should work.

Use the TextChanged event.

.xaml:

<TextBox TextChanged="TextBox_TextChanged" ... />

.xaml.cs:

private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{
    string text = ((TextBox)sender).Text;
    // call your function
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM