LookUpEdit는 드롭 다운 방식으로 데이터를 조회 및 선택 할 수 있는 컨트롤 입니다.
public class CityInfo
{
public int ID { get; set; }
public string City { get; set; }
public string Country { get; set; }
public string Region { get; set; }
}
List<Person> Persons = new List<Person>();
List<CityInfo> Cities = new List<CityInfo>();
CreateData();
LookUpEdit lookUpEdit = new LookUpEdit();
lookUpEdit.Parent = this;
lookUpEdit.Location = new System.Drawing.Point(198,78);
lookUpEdit.Size = new System.Drawing.Size(199,20);
lookUpEdit.DataBindings.Add(new Binding("EditValue", Persons, "CityID"));
lookUpEdit.Properties.DataSource = Cities;
lookUpEdit.Properties.ValueMember = "ID";
lookUpEdit.Properties.DisplayMember = "City";
lookUpEdit.Properties.PopulateColumns();+
private void CreateData()
{
Cities.Add(new CityInfo() { ID = 0, City= "Barquisimeto", Country= "Venezuela", Region="Lara" });
Cities.Add(new CityInfo() { ID = 1, City = "Rio de Janeiro", Country = "Brazil", Region = "RJ" });
Cities.Add(new CityInfo() { ID = 2, City = "Cunewalde", Country = "Germany", Region = "" });
Cities.Add(new CityInfo() { ID = 3, City = "Madrid", Country = "Spain", Region = "" });
Cities.Add(new CityInfo() { ID = 4, City = "Charleroi", Country = "Belgium", Region = "" });
Cities.Add(new CityInfo() { ID = 5, City = "Sao Paulo", Country = "Brazil", Region = "SP" });
}
728x90
'C# > DevExpress' 카테고리의 다른 글
DevExpress / Winform CheckedListBoxItem 컨트롤 추가하기. (0) | 2019.04.15 |
---|---|
DevExpress / Winform LookUpEdit 컨트롤에서 NULL 값에 텍스트 입력하기. (0) | 2019.04.15 |
DevExpress / Winform CheckEdit 컨트롤에서 Indeterminate 값 추가하기. (0) | 2019.04.14 |
DevExpress / Winform CheckEdit 컨트롤 추가하기. (0) | 2019.04.14 |
DevExpress / Winform GridView에서 특정 컬럼의 출력 내용을 변경하기(컬럼 FormatType 설정). (0) | 2019.04.12 |
댓글