Universal Windows Platform (UWP)
A Microsoft platform for building and publishing apps for Windows desktop devices.
2,975 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Is there way of modifying the TextChanged event for a TextBox
to ignore the case that has been entered? Currently in my ListView (containing town names) with a TextBox I want to search for any town name I want without having to use capital letters.
private void txtSearch_TextChanged(object sender, TextChangedEventArgs e)
{
if (string.IsNullOrEmpty(txtSearch.Text))
{
this.ListTowns.ItemsSource = this.listItemTowns;
}
this.ListTowns.ItemsSource = this.listTowns.Where((item) => { return item.TownTitle.Contains(txtSearch.Text); });
}
call .Contains(txtSearch.Text, StringComaprison.InvariantCultureIgnoreCase)