protected bool SelectFromList(List <CatalogItem> list, int selectedIndex, int rowHeight, out CatalogItem selectedItem) { var _selectingItemForm = new WMS_client.Base.Visual.SelectingItem(); _selectingItemForm.SetRowHeight(rowHeight); _selectingItemForm.DataSource = list; _selectingItemForm.SelectedIndex = selectedIndex; this.selectingItemForm = _selectingItemForm; selectingFromList = true; var selectResult = _selectingItemForm.ShowDialog(); selectingFromList = false; this.selectingItemForm = null; if (selectResult == DialogResult.OK) { selectedItem = list[_selectingItemForm.SelectedIndex < 0 ? 0 : _selectingItemForm.SelectedIndex]; return(true); } selectedItem = null; return(false); }
protected bool SelectFromList(List<CatalogItem> list, int selectedIndex, int rowHeight, out CatalogItem selectedItem) { var _selectingItemForm = new WMS_client.Base.Visual.SelectingItem(); _selectingItemForm.SetRowHeight(rowHeight); _selectingItemForm.DataSource = list; _selectingItemForm.SelectedIndex = selectedIndex; this.selectingItemForm = _selectingItemForm; selectingFromList = true; var selectResult = _selectingItemForm.ShowDialog(); selectingFromList = false; this.selectingItemForm = null; if (selectResult == DialogResult.OK) { selectedItem = list[_selectingItemForm.SelectedIndex < 0 ? 0 : _selectingItemForm.SelectedIndex]; return true; } selectedItem = null; return false; }