zoukankan      html  css  js  c++  java
  • DevExpress控件 LookupEdit 模糊查询

    LookupEdit 的具体设置

     //单击回车按钮跳转下一个控件
     this.lookUpEdit1.EnterMoveNextControl = true; 
    
     //添加一个按钮,类型选择Delete,用来删除选中项
     this.lookUpEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Delete, "删除", -1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, null, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.Delete), serializableAppearanceObject1, "删除选中项", "Delete", null, true)});
    
     //在输入框按任一可见字符键时立即弹出下拉窗体
     this.lookUpEdit1.Properties.ImmediatePopup = true; 
    
     this.lookUpEdit1.Properties.NullText = "[请输入……]";
    
     //不用显示表头
     this.lookUpEdit1.Properties.ShowHeader = false; 
    
     //允许选择编辑
     this.lookUpEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; 
    
     this.lookUpEdit1.Properties.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.lookUpEdit1_Properties_ButtonClick);
    
    下面是Delete按钮的事件,设置LookupEdit的EditValue为null就可以清除选中的数据

            private void lookUpEdit1_Properties_ButtonClick(object sender, ButtonPressedEventArgs e)
            {
                if (e.Button.Kind== ButtonPredefines.Delete)
                    lookUpCompanyName.EditValue = null;
            }
    最后给lookUpEdit1的数据源Properties.DataSource 赋值就行了。


  • 相关阅读:
    存储类&作用域&生命周期&链接属性
    关于mysql数据库的备份和还原
    Centos 7下mysql的安装与配置
    基于Apache+php+mysql的许愿墙网站的搭建
    关于php留言本网站的搭建
    linux下面桌面的安装
    时间同步ntp服务的安装与配置
    通过挂载系统光盘搭建本地yum仓库的方法
    linux系统root用户忘记密码的重置方法
    linux系统的初化始配置
  • 原文地址:https://www.cnblogs.com/rsls/p/4364107.html
Copyright © 2011-2022 走看看