DevExpress.LookUpEdit 使用方法

设置可手动输入

this.LookUpEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
  public static void LookUpbd(DevExpress.XtraEditors.LookUpEdit look, string sql,int display,int value)
{
DataTable dt = DAL.SqlDbhelp.GetDataSet(sql);
look.Properties.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoComplete;
look.Properties.DataSource = dt;
look.Properties.DisplayMember = dt.Columns[display].ColumnName; //显示在文本框上的值
look.Properties.ValueMember = dt.Columns[value].ColumnName; //获取的值
look.Properties.NullText = "";
look.Properties.SortColumnIndex = 0;
look.Properties.ImmediatePopup = true; }

以下内容为转载

文章来源 http://blog.sina.com.cn/s/blog_6d1c583c01011qiv.html



详解DevExpress.LookUpEdit控件实现自动搜索定位功能

首先介绍三个重要的属性:



1. LookUpEdit.Properties.ImmediatePopup在输入框按任一可见字符键时立即弹出下拉窗体。

2. LookUpEdit.Properties.AutoSearchColumnIndex设置自动搜索的栏位序号,下拉窗体第一个栏位为0,依此类推,此属性配合SearchMode=OnlyInPopup时有效。

3. LookUpEdit.Properties.SearchMode 自动搜索定位模式









关于枚举类型SearchMode的定义:

C#Code:



    //Summary:

   //    Enumerates search modes for a lookup edior.

    public enumSearchMode

    {

       // Summary:

       //    The incremental search is enabled only when the dropdown window isopen.

       //    If the window is closed, the user can modify the text in the editbox. However

       //    these changes are ignored.

       //    When the dropdown is open the incremental search is performedagainst the

       //    column whose index is specified by theDevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit.AutoSearchColumnIndex

       //    property. The header of this column contains the search icon(binoculars).

       //    The user can click a specific column header to perform the searchagainst

       //    this column.

       //    The following screenshot shows a sample lookup editor. Theincremental search

       //    is performed against the second column.

       OnlyInPopup = 0,

       //

       // Summary:

       //    Enables the automatic completion feature. In this mode, when thedropdown

       //    is closed, the text in the edit box is automatically completed ifit matches

       //    aDevExpress.XtraEditors.Repository.RepositoryItemLookUpEditBase.DisplayMember

       //    field value of one of dropdown rows.

       //    When the dropdown is open, the automatic completion feature isdisabled but

       //    the editor allows you to perform an incremental search in the samemanner

       //    as when DevExpress.XtraEditors.Controls.SearchMode.OnlyInPopup modeis active.

       AutoComplete = 1,

       //

       // Summary:

       //    Enables the incremental filtering feature. When you type within theedit

       //    box, the editor automatically opens the dropdown window anddisplays only

       //    records whoseDevExpress.XtraEditors.Repository.RepositoryItemLookUpEditBase.DisplayMember

       //    field value starts with the characters typed. Other records are notdisplayed.

       //    If you enter a value that does not match any record, the dropdownwindow

       //    will not contain any rows.

       //    The following image shows a lookup editor when AutoFilter mode isenabled.

       AutoFilter = 2,

    }







//来源:C/S框架网(www.csframework.com)QQ:1980854898


OnlyInPopup :配合ImmediatePopup=True时使用,当用户在输入框按任一可见字符键时立即弹出下拉窗体,并跟据输入的字符从头部开始匹配AutoSearchColumnIndex属性指定栏位字段的值,第一个栏位为0.



特点:在下拉窗体能显示匹配结果(蓝底白字),但在输入框内不显示。



效果图如下:









AutoComplete:配合ImmediatePopup=True时使用,当用户在输入框按任一可见字符键时立即弹出下拉窗体,并在输入框自动完成您想要输入的数据,同时下拉窗体自动匹配最佳记录。AutoComplete模式仅匹配DisplayMember对应字段的值。



特点:能在输入框显示匹配的数据,并且下拉窗体显示匹配的记录。



效果图如下:







AutoFilter:配合ImmediatePopup=True时使用,当用户在输入框按任一可见字符键时立即弹出下拉窗体,并在输入框自动完成您想要输入的数据,同时下拉窗体自动过滤掉不匹配的记录。



特点:能在输入框显示匹配的数据,并过滤过不想要的记录。





DevExpress.LookUpEdit控件实现自动搜索定位功能 兼使用方法(looUpEdit可编辑)的更多相关文章

  1. 详解DevExpress.LookUpEdit控件实现自动搜索定位功能(转)

    转载自csdn博客 爱拼才会赢 的博客 地址是详解DevExpress.LookUpEdit控件实现自动搜索定位功能(转)

  2. Devexpress TreeList控件绑定显示父子节点对像

    今天一位同事咨询Devexpress TreeList控件绑定自动显示父子节点对像,但结果是不会显示带父子节点关系,而是将所有的节点作为父节点显示出来了,对像类的代码如下 public class I ...

  3. DevExpress 中 用 LookUpEdit 控件 代替 ComboBoxEdit 控件来绑定 DataTable

    绑定数据及定义列信息 LookUpEdit lue = lookUpEdit1; DataTable dt = new DataTable(); dt.Columns.Add(new DataColu ...

  4. 基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自动适应宽带高度

    在默认情况下,EasyUI的DataGrid好像都没有具备自动宽度的适应功能,一般是指定像素宽度的,但是使用的人员计算机的屏幕分辨率可能不一样,因此导致有些地方显示太大或者太小,总是不能达到好的预期效 ...

  5. (转)基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自动适应宽带高度

    http://www.cnblogs.com/wuhuacong/p/4085725.html 在默认情况下,EasyUI的DataGrid好像都没有具备自动宽度的适应功能,一般是指定像素宽度的,但是 ...

  6. DevExpress WPF控件记录

    以下是博主用到DevExpress WPF控件时的一些记录笔记: 1.Canvas控件:Canvas控件的背景色一定要设置(background="Transparent"),不然 ...

  7. DevExpress 用户控件 分页(上)

    说明:使用用户控件分页,完成后,使用时非常简单,数据绑定,调用自己写的一个事件就OK了 前期准备工作: (1)添加一个用户控件 命名PageCtrl (2)打开代码:   [csharp] view ...

  8. DevExpress 用户控件 分页(中)

    说明: 1)具体调用请关注 看DevExpress 用户控件 分页(下) datanavi_ButtonClick 是DataNavigator的ButtonClikc事件 视图设计器: 分页用户控件 ...

  9. devexpress表格控件gridcontrol图片列,按钮列,时间列等特殊列的实现

    1.项目中经常会在表格中插入按钮列,图片列,表格列一些非文本的特殊列.如何在devexpress表格控件gridcontrol中实现呢?以下列举一个实现添加图片列,按钮列,时间列,按钮列,开关列的示例 ...

随机推荐

  1. android.telephony.SmsManager 短信笔记

    android 几种发送短信的方法 http://www.oschina.net/question/163910_27409 <uses-permission android:name=&quo ...

  2. java求阶乘

    //阶乘 public static int rec(int n){ if(n==1){ return 1; }else{ return n*rec(n-1); } }

  3. nginx启动,重启,关闭

    1.nginx启动: a.     /usr/path/sbin/nginx -c [/etc/path/nginx.conf] 中括号中为指定加载的配置文件,不指定则加载默认配置文件 b.     ...

  4. TCP小结

    TCP/IP协议实现了不同主机,不同操作系统之间信息交流.由4层构成,从上往下依次为: 1.应用层,包括http,ftp等协议,用于实现某一项具体的功能. 2.传输层,包括TCP和UDP,一个可靠,一 ...

  5. 11--Python 备份文件程序

    最近看了下<A Byte of Python>, 看见一个非常有意思的程序,用python进行文件行备份的练习程序, 自己在机器上敲代码运行了一遍,结果出现了一个小问题,路径出错--&qu ...

  6. Redhat_AS5下安装MySQL5.0总结

    一.引言 使用Linux也有几年时间了,由于公司要做radius服务器用用到MySQL.从网上找了些资料. 二.安装Mysql 1.下载MySQL的安装文件 安装MySQL需要下面两个文件: MySQ ...

  7. .Net 读取xml

    一.常规方法 1.知识介绍 //初始化一个xml对象 XmlDocument xml = new XmlDocument(); //加载xml文件 xml.Load("文件路径") ...

  8. IOS 播放视频 MPMoviePlayerController

    在unity游戏的开头播放视频 , 根据需求 , 最后决定用 MPMoviePlayerController 来实现播放, 实现如下: by Tin 需要在AppController.mm的 Open ...

  9. C++中为什么构造函数初始化列表

    已经有个构造函数负责初始化,为什么还需要构造函数初始化表呢? 在以下三种情况下需要使用初始化成员列表:一,需要初始化的数据成员是对象的情况:二,需要初始化const修饰的类成员:三,需要初始化引用成员 ...

  10. C陷阱与缺陷 第一章

    1. 使用 e1=e2的赋值方式 作为 条件语句内部的判断,请使用显示的判断 不使用: if( x =y ) foo(); 而使用: ) foo(); 2. 注意编码规范,一定要在赋值号 “=”两边, ...