DevExpress  lookupedit   目前只能够使用displaynumber进行筛选,哪位大神可以实现多列查询。谢谢了

解决方案 »

  1.   

    请换gridlookupedit
      

  2.   

    根据输入内容 拼接查询语句,查询你的数据源,再绑定到DataSource
      

  3.   

    在gridView 里面打开——Feature browser--找到Filtering——勾上auto filter row 就OK了
      

  4.   

    DevExpress在第一家公司接触过一点点,感觉就是:好难用好麻烦的东西
      

  5.   


            //GridLookUpEdit模糊查询
            private void FilterLookup(object sender, string[] arrFilterField)
            {
                //Text += " ! ";
                GridLookUpEdit edit = sender as GridLookUpEdit;
                GridView gridView = edit.Properties.View as GridView;
                FieldInfo fi = gridView.GetType().GetField("extraFilter", BindingFlags.NonPublic | BindingFlags.Instance);
                //Text = edit.AutoSearchText;
                CriteriaOperator[] arrCriteriaOperator = new CriteriaOperator[arrFilterField.Length];
                for (int i = 0; i < arrFilterField.Length; i++)
                {
                    arrCriteriaOperator[i] = new BinaryOperator(arrFilterField[i],"%"+edit.AutoSearchText + "%", BinaryOperatorType.Like);
                }
                string filterCondition = new GroupOperator(GroupOperatorType.Or, arrCriteriaOperator).ToString();
                fi.SetValue(gridView, filterCondition);
                MethodInfo mi = gridView.GetType().GetMethod("ApplyColumnsFilterEx", BindingFlags.NonPublic | BindingFlags.Instance);
                mi.Invoke(gridView, null);
            }//绑定事件
            void cmbZyzd_Properties_Popup(object sender, EventArgs e)
            {
                FilterLookup(sender, new string[] { "Name", "Code","Spell" });//中文,编码,拼音
            }
            void cmbZyzd_TextChanged(object sender, EventArgs e)
            {
                GridLookUpEdit edit = sender as GridLookUpEdit;
                edit.SelectionStart = edit.Text.Length;
            }
            void cmbZyzd_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
            {
                this.BeginInvoke(new System.Windows.Forms.MethodInvoker(delegate
                {
                    FilterLookup(sender, new string[] { "Name", "Code", "Spell" });
                }));
            }
            //加载主要诊断
            void LoadZyzd()
            {            DataTable dt = new CDM_HB_ICD10BLL().GetZYZDData();//数据源
                this.cmbZyzd.Properties.Popup -= new EventHandler(cmbZyzd_Properties_Popup);
                this.cmbZyzd.EditValueChanging -= new DevExpress.XtraEditors.Controls.ChangingEventHandler(cmbZyzd_EditValueChanging);
                this.cmbZyzd.TextChanged -= new EventHandler(cmbZyzd_TextChanged);
                this.cmbZyzd.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
                this.cmbZyzd.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
                this.cmbZyzd.Properties.AutoComplete = false;
                this.cmbZyzd.Properties.ImmediatePopup = true;
                this.cmbZyzd.Properties.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
                this.cmbZyzd.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
                this.cmbZyzd.Properties.DataSource =dt;
                this.cmbZyzd.Properties.ValueMember = "Code";
                this.cmbZyzd.Properties.DisplayMember = "Name";
                this.cmbZyzd.Properties.Popup += new EventHandler(cmbZyzd_Properties_Popup);
                this.cmbZyzd.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(cmbZyzd_EditValueChanging);
                this.cmbZyzd.TextChanged += new EventHandler(cmbZyzd_TextChanged);        }
    可以去慢慢参悟,不懂的可以问我
      

  6.   

    10楼的方法能现实[GridLookUpEdit]、但可惜[LookUpEdit]控件用不了