I´ve been searching the site and internet trying to find a solution but I couldn´t find it.
I have ordered my items using the AlphaKeyGroup example provided by Microsoft. However, the users will have a search box at the top, also, to filter this list and I can´t realize on how to do this filtering.
The MS says
private void getListItems()
{
var alphaKeyGroup = AlphaKeyGroup<Stores>.CreateGroups(
Database_Controller.getStoreValues(), // basic list of items
(Stores s) => { return s.Name; }, // the property to sort
true); // order the items
// returns type List<AlphaKeyGroup<SampleItem>>
ListViewCollectionSource.Source = alphaKeyGroup;
}
So I have try these two ways
var alphaKeyGroup = AlphaKeyGroup<Stores>.CreateGroups(Database_Controller.getStoreValues(), (Stores s) => s.Name, true).Where(s => Name.Contains(searchKeyword.Text));
var alphaKeyGroup = AlphaKeyGroup<Stores>.CreateGroups(Database_Controller.getStoreValues(), (Stores s) => { return s.Name.Where(s.Name.Contains(searchKeyword.Text)) ; },true);
The first one brings nothing to the ListView, and the second does not compile.
What am I doing wrong?
I have found a workaround about this and IT´S WORKING!!!
(anyway, you guys tell me if this is the best way to do it)