Hi, here I am going to fill my combo box "
cmbCategory" with
dictionary "_dtcCategory". Its pretty simple
Here is the Code:
Dictionary < int, string > _dtcCategory = new Dictionary < int, string > ();
_dtcCategory.Add(0, " -Select- ");
_dtcCategory.Add(1, "Students");
_dtcCategory.Add(2, "Employees");
cmbCategory.DataSource = new BindingSource(_dtcCategory, null);
cmbCategory.DisplayMember = "Value";
cmbCategory.ValueMember = "Key";
No comments:
Post a Comment