根据字母选择列出的记录 [英] Select listed records based on alphabet

查看:73
本文介绍了根据字母选择列出的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



通过单击应用程序顶部或底部的字母,正在寻找有关搜索记录列表的帮助.

我已经在列出记录了,但是由于列表很大,所以我想根据字母选择来选择记录,因为很难在接下来的20页中单击下一步"来获得我想要的内容.

任何帮助表示赞赏!!!!

感谢

Hi,

Am looking for some help with searching the list of records by clicking the alphabet on the top or at the bottom of the application.

I am already listing the records but since the list is huge, i would like to select the record based on the alphabet select as it will be difficult to click next for next 20 pages to get to what I want.

Any help appreciated!!!!

Thanks

推荐答案

最简单的方法是使用CollectionView过滤数据.基本上,在WPF中,所有集合都公开一个可以通过以下方式访问的集合视图:
The easiest way to do this is to use a CollectionView to filter the data on. Basically, all collections, in WPF, expose a collection view which you can get access to like this:
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(DataContext);

像这样过滤数据:

view.Filter = new Predicate<object>(HasLetter);
// Other commands

public book HasLetter(object o)
{
  ItemCollectionType t = o as ItemCollectionType;
  if (t == null) return false;
  return t.Name.StartsWith("F");
}


这篇关于根据字母选择列出的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆