[DevExpress]控件之GridLookupedit的运用

代码:

        #region 内部主题绑定
        private void gridLookupeditBind() 
        {
            DataTable dt = new DataTable();
            string strSql = "SELECT [ID],[subject],[htmlURL] FROM [OA].[dbo].[OA_SubjectQuery]";
            dt = DbHelperSQL.Query(strSql).Tables[0];

            try 
            {
                this.gloksubject.Properties.DataSource = dt;
                this.gloksubject.Properties.DisplayMember = dt.Columns[1].ColumnName;
                this.gloksubject.Properties.ValueMember = dt.Columns[2].ColumnName;

                this.gloksubject.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
                this.gloksubject.Properties.View.BestFitColumns();
                this.gloksubject.Properties.ShowFooter = false;
                this.gloksubject.Properties.View.OptionsView.ShowAutoFilterRow = true; //显示不显示grid上第一个空行,也是用于检索的应用
                this.gloksubject.Properties.AutoComplete = false;
                this.gloksubject.Properties.ImmediatePopup = true;
                this.gloksubject.Properties.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
                this.gloksubject.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;

                
            } 
            catch(Exception ex)
            {
                XtraMessageBox.Show(ex.ToString(), "警告");
            }

       
        }
        #endregion
效果:



发布了921 篇原创文章 · 获赞 374 · 访问量 325万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 鲸 设计师: meimeiellie

分享到微信朋友圈

×

扫一扫,手机浏览