Esempio n. 1
0
        public static void CargarRepositoryItemSearchLookUpEdit(RepositoryItemSearchLookUpEdit slue, object dataSource, List <BESearchLookUpEdit> lstSLUE)
        {
            BindingSource bs = new BindingSource();

            bs.DataSource = dataSource;

            slue.DataSource = null;


            slue.ValueMember   = lstSLUE[0].fieldName;
            slue.DisplayMember = lstSLUE[1].fieldName;
            slue.PopulateViewColumns();

            foreach (var item in lstSLUE)
            {
                slue.View.Columns.Add(new GridColumn {
                    Caption = item.caption, FieldName = item.fieldName, Visible = false
                });
            }
            slue.View.Columns[1].Visible = true;

            slue.DataSource = bs;
            //slue..Columns[0].Visible = false;
            //slue.Properties.DataSource = dataSource;
            //lue.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            //lue.Properties.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
        }
Esempio n. 2
0
 /// <summary>
 /// 设置RepositoryItemSearchLookUpEdit基本属性
 /// </summary>
 /// <param name="p_DrpID">RepositoryItemSearchLookUpEdit控件</param>
 /// <param name="p_dt">数据源DataTable</param>
 /// <param name="p_ValueMember">ValueMember</param>
 /// <param name="p_DisplayMember">DisplayMember</param>
 /// <param name="p_NullText">控件值为空时显示的文字</param>
 public static void LoadRepositorySearch(RepositoryItemSearchLookUpEdit p_DrpID, DataTable p_dt, string p_ValueMember, string p_DisplayMember, string p_NullText)
 {
     p_DrpID.DataSource    = p_dt;
     p_DrpID.ValueMember   = p_ValueMember;
     p_DrpID.DisplayMember = p_DisplayMember;
     p_DrpID.NullText      = p_NullText;
     p_DrpID.PopulateViewColumns();
     p_DrpID.Popup += new System.EventHandler(p_DrpID_Popup);
 }