zoukankan      html  css  js  c++  java
  • 逻辑代码实现拼音首字母检索

    private void WTNR_GRID_jbzl_AutoCompleteBox_Loaded(object sender, System.Windows.RoutedEventArgs e)

            {

                List<JBJS> cs = new List<JBJS>();

                cs.Add(new JBJS { Name = "广州", ShortName = "GZ" });

                cs.Add(new JBJS { Name = "南京", ShortName = "NJ" });

                cs.Add(new JBJS { Name = "上海", ShortName = "SH" });

                cs.Add(new JBJS { Name = "北京", ShortName = "BJ" });

                cs.Add(new JBJS { Name = "扬州", ShortName = "YZ" });

                cs.Add(new JBJS { Name = "杭州", ShortName = "HZ" });

                WTNR_GRID_jbzl_AutoCompleteBox.ItemFilter = (search, item) =>

                {

                    JBJS city = item as JBJS;               

                    if (city != null)              

                    {                  

                        string filter = search.ToLower();                   

                         return city.Name.Contains(filter) |city.ShortName.ToLower().Contains(filter);

                    }              

                    return false;      

                };

               WTNR_GRID_jbzl_AutoCompleteBox.ItemsSource = cs;

            }

  • 相关阅读:
    Java EE 在网页输出九九乘法表、三角形、菱形
    Java EE 在网页输出九九乘法表
    格式化时间(SimpleDateFormat)
    Java代码规范性
    Scanner
    数据库怎么删除相同的内容
    连接池 ----单例模式
    多态和接口
    第一个JAVA应用
    继承
  • 原文地址:https://www.cnblogs.com/chuhaida/p/3193663.html
Copyright © 2011-2022 走看看