private void AutoCompleteCustomer() { foreach (DataGridViewRow row in dgvCustomer.Rows) { DataGridViewComboBoxCell nameCell = ((DataGridViewComboBoxCell)row.Cells["colCustomerName"]); nameCell.Items.Clear(); var custInfo = newDB.CustomerTbls.Where(s => s.Status == "Active" & s.Type == "Customer").Select(s => s); foreach (var c in custInfo) { nameCell.Items.Add("(" + c.Id + ") " + c.Name); } } } private void dgvCustomer_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { AutoCompleteCustomer(); }
private void FillForm() { lblInvoiceNumber.Text = InvoiceNumber; lblItemName.Text = leslieDB.GAItemTbls.Where(i => i.Status == "Active" & i.PartNo == _partNo).Select(i => i.Name).Single(); var relInfo = from r in leslieDB.GARelationTbls.Where(r => r.Item_PartNo == _partNo & r.InvoiceNumber == InvoiceNumber & r.Status == "Active") join c in leslieDB.CustomerTbls on r.Customer_Id equals c.Id where c.Status == "Active" & c.Type == "Customer" select new { r.Id, Name = c.Name, cId = c.Id, r.Quantity }; foreach (var re in relInfo) { dgvCustomer.Rows.Add(re.Id, "(" + re.cId + ") " + re.Name, re.Quantity); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)