ignore case query
-
Wednesday, July 04, 2012 7:27 AM
hi all, i m new in windows phone 7 apps development.my problem is i want to filter data from listbox when type on textbox.m able to filter data from listbox but how can i make it case insensivity.my code is
private void txtSearch_TextChanged(object sender, TextChangedEventArgs e)
{
var search = new ObservableCollection<Products>();
string _search = "select ProductName,SKUNo from Products";
search = (Application.Current as App).db.SelectObservableCollection<Products>(_search);
lstUser.ItemsSource =search.Where(x => x.ProductName.StartsWith(txtSearch.Text.Trim()));
}please help me.
Thanx in advance.
All Replies
-
Wednesday, July 04, 2012 9:37 AM
Hi,
Try this
lstUser.ItemsSource =search.Where(x => x.ProductName.StartsWith(txtSearch.Text.Trim(),StringComparison.CurrentCultureIgnoreCase));
--private void txtSearch_TextChanged(object sender, TextChangedEventArgs e)
{
var search = new ObservableCollection<Products>();
string _search = "select ProductName,SKUNo from Products";
search = (Application.Current as App).db.SelectObservableCollection<Products>(_search); lstUser.ItemsSource =search.Where(x => x.ProductName.StartsWith(txtSearch.Text.Trim(),StringComparison.CurrentCultureIgnoreCase));
}
PS.Shakeer Hussain
- Edited by Syed Shakeer HussainMicrosoft Contingent Staff Wednesday, July 04, 2012 11:39 AM
- Proposed As Answer by Chester HongMicrosoft Contingent Staff, Moderator Thursday, July 05, 2012 6:48 AM
- Marked As Answer by Chester HongMicrosoft Contingent Staff, Moderator Monday, July 09, 2012 10:41 AM
-
Thursday, July 05, 2012 6:51 AMThanx shakeer. it is working well.Thanx again.
-
Thursday, July 05, 2012 7:11 AM
Welcome Khalid.
Mark it as Answered
PS.Shakeer Hussain
- Edited by Syed Shakeer HussainMicrosoft Contingent Staff Thursday, July 05, 2012 3:32 PM


