I was unable to bind the selected combobox value.
public void InitializePage()
{
cbStatus.DataSource = Enum.GetValues(typeof(CourseStudentStatus));
}
in my constructor
public EditCourseForm(int status)
{
InitializePage();
cbStatus.SelectedText = Enum.GetName(
typeof(CourseStudentStatus), status).ToString();
}
I also tried this.
cbStatus.SelectedValue = Status
but I cannot set SelectedValue to ComboBox.
Update
My listing
public enum CourseStudentStatus
{
Active = 1,
Completed = 2,
TempStopped = 3,
Stopped = 4,
}
source
share