原创

[DevExpress]控件之GridLookupedit的运用

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://david.blog.csdn.net/article/details/51119612

代码:

        #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
效果:



文章最后发布于: 2016-04-11 10:32:36
展开阅读全文
0 个人打赏

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

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

分享到微信朋友圈

×

扫一扫,手机浏览