DevExpress.LookUpEdit控件实现自动搜索定位功能 兼使用方法(looUpEdit可编辑)
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的定义:
//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可编辑)的更多相关文章
- 详解DevExpress.LookUpEdit控件实现自动搜索定位功能(转)
转载自csdn博客 爱拼才会赢 的博客 地址是详解DevExpress.LookUpEdit控件实现自动搜索定位功能(转)
- Devexpress TreeList控件绑定显示父子节点对像
今天一位同事咨询Devexpress TreeList控件绑定自动显示父子节点对像,但结果是不会显示带父子节点关系,而是将所有的节点作为父节点显示出来了,对像类的代码如下 public class I ...
- DevExpress 中 用 LookUpEdit 控件 代替 ComboBoxEdit 控件来绑定 DataTable
绑定数据及定义列信息 LookUpEdit lue = lookUpEdit1; DataTable dt = new DataTable(); dt.Columns.Add(new DataColu ...
- 基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自动适应宽带高度
在默认情况下,EasyUI的DataGrid好像都没有具备自动宽度的适应功能,一般是指定像素宽度的,但是使用的人员计算机的屏幕分辨率可能不一样,因此导致有些地方显示太大或者太小,总是不能达到好的预期效 ...
- (转)基于MVC4+EasyUI的Web开发框架经验总结(13)--DataGrid控件实现自动适应宽带高度
http://www.cnblogs.com/wuhuacong/p/4085725.html 在默认情况下,EasyUI的DataGrid好像都没有具备自动宽度的适应功能,一般是指定像素宽度的,但是 ...
- DevExpress WPF控件记录
以下是博主用到DevExpress WPF控件时的一些记录笔记: 1.Canvas控件:Canvas控件的背景色一定要设置(background="Transparent"),不然 ...
- DevExpress 用户控件 分页(上)
说明:使用用户控件分页,完成后,使用时非常简单,数据绑定,调用自己写的一个事件就OK了 前期准备工作: (1)添加一个用户控件 命名PageCtrl (2)打开代码: [csharp] view ...
- DevExpress 用户控件 分页(中)
说明: 1)具体调用请关注 看DevExpress 用户控件 分页(下) datanavi_ButtonClick 是DataNavigator的ButtonClikc事件 视图设计器: 分页用户控件 ...
- devexpress表格控件gridcontrol图片列,按钮列,时间列等特殊列的实现
1.项目中经常会在表格中插入按钮列,图片列,表格列一些非文本的特殊列.如何在devexpress表格控件gridcontrol中实现呢?以下列举一个实现添加图片列,按钮列,时间列,按钮列,开关列的示例 ...
随机推荐
- maven混淆Java代码
Maven 环境下使用 proguard-maven-plugin 插件混淆你的源码 时间 2014-08-20 15:23:56 肖国颖的个人页面 原文 http://my.oschina.net ...
- 关于 HIVE Beeline 问题
1 启动 hiveserver2 服务,启动 beeline -u jdbc:hive2:// 正常 ,启动 beeline -u jdbc:hive2://127.0.0.1:10000 包如下错 ...
- @ResponseBody返回json时,json数据丢失或者报错
现象: 1.报错:There is a cycle in the hierarchy! 2.返回至前台的json不完整,字段丢失. 错误原因: eg:entity1的属性有list<entiti ...
- 用VBS控制鼠标的实现代码(获取鼠标坐标、鼠标移动、鼠标单击、鼠标双击)
网上搜到的答案普遍是VBS无法实现,或者是要用第三方COM(ActiveX?)组件.我对第三方组件是很反感的,使用第三方组件毫无可移植性可言,因为别人的系统中不一定注册了这个组件.我的建议是,尽量不要 ...
- Centos7下安装numpy+matplotlib+scipy
摘自:http://litchiware.github.io/centos/2015/07/05/centos7%E4%B8%8B%E5%AE%89%E8%A3%85numpy+matplotlib+ ...
- split a string in C++
This is my favourite way to iterate through a string. You can do what you want per word. string line ...
- SUPERVISOR进程管理器配置指南
SUPERVISOR进程管理器配置指南1. supervisor简介1.1. 官网http://supervisord.org/ 1.2. 介绍Supervisor是一个进程控制系统. 它是一个C/S ...
- 如何测试本地是否能够正常访问云服务器的 Web 端口
在windows环境下打开DOS命令行 使用telnet命令.例如 telnet www.baidu.com 80 插播一条小知识:DOS下清屏的命令是cls. 首先很不幸,出现了['telnet' ...
- wifi的UI控制。打不开UI
部分主要是您要清楚WiFi作为什么功能,即WiFi是仅仅作为station功能,还是要开启p2p功能,当WiFi作为station功能时候开启的是wpa_supplicant服务,当WiFi作为p2p ...
- keepalived 健康检测
1.TCP方式 详见:http://www.cnblogs.com/tengpan-cn/p/5776574.html 以下内容,都是基于此进行修改 2.HTTP_GET 根据返回状态判断服务器是否正 ...