[DevExpress]控件之GridLookupedit的运用

来源:互联网 发布:厦门网络文化节 编辑:程序博客网 时间:2024/05/29 23:22

代码:

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



0 0
原创粉丝点击