public setTask() { InitializeComponent(); //dtTaskDate.Format = DateTimePickerFormat.Custom; //dtTaskDate.CustomFormat = "dd-MM-yyyy"; //Load Employee Combo Box m_em = new BindingSource(); m_employees = tl.getEmployees(); m_em.DataSource = m_employees; cmbEmployees.DataSource = m_em; //Load Task Type Combo Box m_tt = new BindingSource(); m_taskTypes = tl.getTaskTypes(); m_tt.DataSource = m_taskTypes; cmbTaskTypes.DataSource = m_tt; //Load Task Status Combo Box m_cr = new BindingSource(); m_crops = tl.getCrops(); m_cr.DataSource = m_crops; cmbCrops.DataSource = m_cr; //Load Field Combo Box m_fd = new BindingSource(); m_fields = tl.getFields(); m_fd.DataSource = m_fields; cmbFields.DataSource = m_fd; //Load Vehicle Combo Box m_ve = new BindingSource(); m_vehicles = tl.getVehicles(); m_ve.DataSource = m_vehicles; cmbVehicles.DataSource = m_ve; //Load Storage Unit Combo Box m_su = new BindingSource(); m_storageUnits = tl.getStorageUnits(); m_su.DataSource = m_storageUnits; cmbStorageUnit.DataSource = m_storageUnits; m_dg = new BindingSource(); m_tasks = tl.getTasks(); m_dg.DataSource = m_tasks; m_dg.ResetBindings(true); this.dgdTasksList.DataSource = m_dg.DataSource; this.dgdTasksList.RowHeadersVisible = false; this.dgdTasksList.Columns[0].Visible = false; }