コード例 #1
0
 public void PopulateListIntakeCourse()
 {
     grdListIntakeCourses.DataSource = FunctionBase.ToDataTable(_intakeCourseService.GetIntakeCourses(txtSearch.Text));
     if (grdListIntakeCourses.ColumnCount > 0)
     {
         grdListIntakeCourses.Columns["IntakeCourseID"].Visible = false;
         grdListIntakeCourses.Columns["CourseID"].Visible       = false;
     }
 }
コード例 #2
0
        private void PopulateCbxSearchLecturer()
        {
            List <Lecturer> lecturerList = _lecturerService.GetAll();

            lecturerList.Insert(0, new Lecturer {
                FirstName = "Select", MiddleName = "Lecturer", LastName = "", LecturerID = "Select Lecturer"
            });
            DataTable lecturer = FunctionBase.ToDataTable(lecturerList);

            lecturer.Columns.Add("FullName", typeof(string), "FirstName +' '+ MiddleName +' '+ LastName");
            cbxSearchLecturer.DataSource         = lecturer;
            cbxSearchLecturer.DisplayMember      = "FullName";
            cbxSearchLecturer.ValueMember        = "LecturerID";
            cbxSearchLecturer.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            cbxSearchLecturer.AutoCompleteSource = AutoCompleteSource.ListItems;
        }