public Item_UpdateForm() { InitializeComponent(); sql = new MySQLDatabaseDriver(); supplierList = new ArrayList(); sql.SelectAllSuppliers(supplierList); supplierDropdownList = new ArrayList(); sql.SelectAllSupplierNames(supplierDropdownList); supplierDropdownList.Sort(); //Sort list alphabetically supplierDropdownList.Insert(0, "Select Supplier"); cbbSupplierName.DataSource = supplierDropdownList; }
private int supplierIDFK; //RFQ Foreign Key 2 //CONSTRUCTOR public RFQ_CreateForm() { InitializeComponent(); sql = new MySQLDatabaseDriver(); //Instantiate ArrayLists and populate them customerDropdownList = new ArrayList(); sql.SelectAllCustomerNames(customerDropdownList); customerDropdownList.Sort(); //Sort list alphabetically customerDropdownList.Insert(0, "Select Customer"); cbbCustomerName.DataSource = customerDropdownList; //Populate the dropdown supplierItemList = new ArrayList(); supplierList = new ArrayList(); //Need all the Supplier Details, since there's Supplier auto-complete sql.SelectAllSuppliers(supplierList); supplierDropdownList = new ArrayList(); sql.SelectAllSupplierNames(supplierDropdownList); supplierDropdownList.Sort(); //Sort list alphabetically supplierDropdownList.Insert(0, "Select Supplier"); cbbSupplierName.DataSource = supplierDropdownList; //Populate the dropdown //Set default Combo Box values cbbFilterBy.SelectedIndex = 0; //"Filter by..." cbbPaymentTerms.SelectedIndex = 0; //"Select" cbbDeliveryTerms.SelectedIndex = 0; // "Select" //txtItemName.Text = dgvItemSelection.SelectedRows[0].Cells["ItemName"].Value.ToString(); --> Moved to cbbSupplierName_SelectedIndexChanged rfqOrderLineList = new ArrayList(); //---ADJUST DATAGRIDVIEW COLUMN ALIGNMENT //Center column headings dgvItemSelection.Columns["UOM"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvItemSelection.Columns["UOM"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvRFQItems.Columns["RFQUOM"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvRFQItems.Columns["Qty"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; //Center column cell contents dgvItemSelection.Columns["PartNo"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvItemSelection.Columns["UOM"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvRFQItems.Columns["RFQUOM"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvRFQItems.Columns["Qty"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; //Right-align column headings dgvItemSelection.Columns["UnitPrice"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight; //Right-align column cell contents dgvItemSelection.Columns["UnitPrice"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; }