private void Productionvoucher_Load(object sender, EventArgs e) { Models.AccountLookup acc = new Models.AccountLookup(); // Create an in-place LookupEdit control. RepositoryItemLookUpEdit riLookup = new RepositoryItemLookUpEdit(); acc.InitData(); riLookup.DataSource = acc.Categories; riLookup.ValueMember = "ID"; riLookup.DisplayMember = "CategoryName"; // Enable the "best-fit" functionality mode in which columns have proportional widths and the popup window is resized to fit all the columns. riLookup.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup; // Specify the dropdown height. riLookup.DropDownRows = acc.Categories.Count; // Enable the automatic completion feature. In this mode, when the dropdown is closed, // the text in the edit box is automatically completed if it matches a DisplayMember field value of one of dropdown rows. riLookup.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoComplete; // Specify the column against which an incremental search is performed in SearchMode.AutoComplete and SearchMode.OnlyInPopup modes riLookup.AutoSearchColumnIndex = 1; // Optionally hide the Description column in the dropdown. // riLookup.PopulateColumns(); // riLookup.Columns["Description"].Visible = false; // Assign the in-place LookupEdit control to the grid's CategoryID column. //// Note that the data types of the "ID" and "CategoryID" fields match. gdvItemIG.Columns["Item"].ColumnEdit = riLookup; gdvItemIG.BestFitColumns(); gdvItemIC.Columns["Item"].ColumnEdit = riLookup; gdvItemIC.BestFitColumns(); //Bill Sundry Lookup Edit //gridBs.Columns["BillSundry"].ColumnEdit = riLookup; //gridBs.BestFitColumns(); //Series Lookup Edit SeriesLookup objSeries = new SeriesLookup(); tbxSeries.Properties.DataSource = objSeries.Series; //Productin matecenter Lookup Edit tbxMatcenterIC.Properties.DataSource = objSeries.Series; tbxMatcenterIG.Properties.DataSource = objSeries.Series; //Party Lookup Edit //tbxParty.Properties.DataSource = acc.Categories; //tbxParty.Properties.DisplayMember = "CategoryName"; //tbxParty.Properties.ValueMember = "CategoryName"; ////Mat Centre Lookup Edit //tbxMatCentre.Properties.DataSource = acc.Categories; //tbxMatCentre.Properties.DisplayMember = "CategoryName"; //tbxMatCentre.Properties.ValueMember = "CategoryName"; }
private void ReceiptVoucher_Load(object sender, EventArgs e) { Models.AccountLookup acc = new Models.AccountLookup(); //gdvJournal.DataSource = DataSets.JournalDs.; // Create an in-place LookupEdit control. RepositoryItemLookUpEdit riLookup = new RepositoryItemLookUpEdit(); acc.InitData(); riLookup.DataSource = acc.Categories; riLookup.ValueMember = "ID"; riLookup.DisplayMember = "CategoryName"; // Enable the "best-fit" functionality mode in which columns have proportional widths and the popup window is resized to fit all the columns. riLookup.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup; // Specify the dropdown height. riLookup.DropDownRows = acc.Categories.Count; // Enable the automatic completion feature. In this mode, when the dropdown is closed, // the text in the edit box is automatically completed if it matches a DisplayMember field value of one of dropdown rows. riLookup.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoComplete; // Specify the column against which an incremental search is performed in SearchMode.AutoComplete and SearchMode.OnlyInPopup modes riLookup.AutoSearchColumnIndex = 1; // Optionally hide the Description column in the dropdown. // riLookup.PopulateColumns(); // riLookup.Columns["Description"].Visible = false; // Assign the in-place LookupEdit control to the grid's CategoryID column. // Note that the data types of the "ID" and "CategoryID" fields match. gdvReceipt.Columns["Account"].ColumnEdit = riLookup; gdvReceipt.BestFitColumns(); RepositoryItemLookUpEdit riDCLookup = new RepositoryItemLookUpEdit(); riDCLookup.DataSource = new string[] { "D", "C" }; gdvReceipt.Columns["DC"].ColumnEdit = riDCLookup; riDCLookup.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoFilter; riDCLookup.AutoSearchColumnIndex = 1; riDCLookup.DropDownRows = 0; }