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中实现呢?以下列举一个实现添加图片列,按钮列,时间列,按钮列,开关列的示例 ...
随机推荐
- Nginx负载均衡反向代理 后端Nginx获取客户端真实IP
Nginx 反向代理后,后端Nginx服务器无法正常获取客户端的真实IP nginx通过http_realip_module模块来实现的这需要重新编译,如果提前编译好了就无需重新编译了1,重新编译ng ...
- 一把刀终极配置Win7/8版 v2.0 绿色版
软件名称: 一把刀终极配置Win7/8版 软件语言: 简体中文 授权方式: 免费软件 运行环境: Win8 / Win7 软件大小: 1.3MB 图片预览: 软件简介: 一把刀终极配置 For Win ...
- python中的矩阵运算
摘自:http://m.blog.csdn.net/blog/taxueguilai1992/46581861 python的numpy库提供矩阵运算的功能,因此我们在需要矩阵运算的时候,需要导入nu ...
- Chrome 自动填充的表单是淡黄色的背景怎么办!
chrome浏览器自动填充表单的黄色背景高亮(#FAFFBD)一直困扰着我,我之前没想着理它,可是最近一个登陆框,需要用到图标,于是我草率的直接设置在input元素里面,结果问题就来了,很难看很难看, ...
- app.use(express.static)设置静态文件目录小解
app.use(path, function, [, function]) 功能: 为path注册中间函数,即根据path使用不同函数进行处理,默认path是"/",也就是处理任何 ...
- Cenots安装openvpn、pam_mysql进行用户认证和流量控制
一.安装Centos6.5 二.修改YUM仓库 1. 默认仓库不能访问部分软件包,因此我们需要修改YUM仓库 cd /etc/yum.repos.d #备份 mv ./CentOS-Base.repo ...
- Flask -- 静态文件 和 模板渲染
静态文件 一般用于存放图片,样式文件(css, js等) 保存位置:包中或者文件所在目录创建一个 static 目录 访问:在应用中使用 /static/...即可访问 , 更好的方式是使用url_f ...
- android代码格式化方法小结
转载:http://blog.csdn.net/androidzhaoxiaogang/article/details/7692526 Download the android-formatting. ...
- 解决安装WordPress主题及插件需要输入FTP问题
http://www.zhanghenglei.com/wordpress-ftp-update/ 使用Wordpress程序架构的网站如果需要在网站后台升级.安装主题或者插件的时候,总是会提示需要我 ...
- Android底部导航栏创建——ViewPager + RadioGroup
原创文章,引用请注明出处:http://www.cnblogs.com/baipengzhan/p/6270201.html Android底部导航栏有多种实现方式,本文详解其中的ViewPager ...