DEV LookUpEdit下拉框總結


DEV LookUpEdit下拉框總結
DevExpress.XtraEditors.LookUpEdit
設定Properties中一些重要的屬性
 ValueMember屬性,實際的值
 DisplayMember屬性,顯示的值
 NullText屬性,默認的屬性值,如“請選擇”,
 ShowFooter屬性,設定為false
 ShowHeader屬性,設定為false
 PopupFormMinSize屬性,設定彈出的項的寬度

右擊控件設定EditComlumns,目的設定那些列顯示出來
一些在程序邏輯中寫的代碼

 1 //cmbProvince下拉菜單
 2             ProvinceModel bindProvinceModel = new ProvinceModel();
 3             string strBindProvince = Newtonsoft.Json.JsonConvert.SerializeObject(bindProvinceModel);
 4             string strResult = WebLockConfig.Instance.webProvince.GetProvinceDS(strBindProvince);
 5             DataSet ds = Newtonsoft.Json.JsonConvert.DeserializeObject<DataSet>(strResult);
 6 
 7             DataRow dr = ds.Tables[0].NewRow();
 8             dr["PRO_ID"] = "";
 9             dr["PRO_NAME"] = "請選擇";
10             ds.Tables[0].Rows.InsertAt(dr,0);
11             cmbProvince.SelectedText = "請選擇";
12             cmbProvince.Properties.DataSource = ds.Tables[0];
13             cmbProvince.Properties.DropDownRows = ds.Tables[0].Rows.Count;
14 
15             bindProvinceModel = null;
16             ds = null;
17             dr = null;
18 
19         .......
20             //把窗體上的值設定給Model
21             cityModel.PRO_ID = cmbProvince.EditValue.ToString();
22 
23 
24         ......
25             //設定本窗口的默認輸入信息
26         cmbProvince.EditValue = ds.Tables[0].Rows[0]["PRO_ID"].ToString();

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM