zoukankan      html  css  js  c++  java
  • lookUpEdit 绑定数据

    //绑定lookUpEdit

            private void BoundData()   

          {

                string sql = "select daID,xm,sfzh from baseinfo";

                DataSet ds = bga.getTable(sql);

                if (ds != null)

                {

                    int rows = ds.Tables[0].Rows.Count;

                    lookUpEdit1.EditValue = "daID";

                    lookUpEdit1.Properties.ValueMember = "daID";

                    lookUpEdit1.Properties.DisplayMember = "xm";

                    lookUpEdit1.Properties.DataSource = ds.Tables[0];

                    //自适应宽度

                    //lookUpEdit1.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;

                    //填充列

                    lookUpEdit1.Properties.PopulateColumns();

                    //设置列属性

                    //lookUpEdit1.Properties.Columns[0].Visible = false;

                    lookUpEdit1.Properties.Columns[1].Caption = "姓名";

                    lookUpEdit1.Properties.Columns[2].Caption = "身份证号";

                    lookUpEdit1.Properties.Columns[1].Width = 120;

                    lookUpEdit1.Properties.Columns[2].Width = 300;

                    //控制选择项的总宽度

                    lookUpEdit1.Properties.PopupWidth = 500;

                    //列格式设置

                    lookUpEdit1.Properties.Columns[0].FormatString = "000000";

                    //选择第一项

                    lookUpEdit1.ItemIndex = 0;

                  }

            }

            //值改变事件

            private void lookUpEdit1_EditValueChanged(object sender, EventArgs e)

            {

                string daID = this.lookUpEdit1.EditValue.ToString();

           //是ookUpEdit.Properties.ValueMember的值

                string xm = this.lookUpEdit1.Text.Trim();

            }

  • 相关阅读:
    JavaScript通过HTML的class来获取HTML元素的方法总结
    HTML5之FileReader接口读取文件
    简单好用用js就可以保存文本文件到本地
    JS获取节点的兄弟,父级,子级元素的方法
    删除window里面删除不掉的文件
    《软件过程改进》练习题
    软件过程改进2016下半年真题及答案
    jquery
    JSP入门
    JAVA方法
  • 原文地址:https://www.cnblogs.com/dogxuefeng/p/2739201.html
Copyright © 2011-2022 走看看