//Load main transaction type listbox lstTransTypes private void loadLstTransTypes() { ArrayList arrNew = new ArrayList(); String[] tmpArray = InfoLoader.loadTransTypes(false).Split('\n'); //false = non-utility trans types for (int i = 0; i < tmpArray.Length; i++) { String[] cols = tmpArray[i].Split('\t'); if (cols.Length == 2) { arrNew.Add(new ListValues(cols[0], cols[1], ListValues.FORWARD)); arrNew.Sort(); } } if (arrNew.Count > 0) { lstTransTypes.DataSource = arrNew; lstTransTypes.DisplayMember = "Desc"; lstTransTypes.ValueMember = "ID"; } lstTransTypes.ClearSelected(); }
private void loadLstTransTypes() { // Create an instance of a ListView column sorter and assign it // to the ListView control. lvwColumnSorter = new ListViewColumnSorter(); this.lstTransactions.ListViewItemSorter = lvwColumnSorter; ArrayList arrNew = new ArrayList(); String[] tmpArray = InfoLoader.loadTransTypes(false).Split('\n'); //false = non-utility trans types selectedTransType = ""; lstTransTypes.BeginUpdate(); lstTransTypes.Clear(); lstTransTypes.Columns.Add("Trans Type", 140, HorizontalAlignment.Left); lstTransTypes.Columns.Add("_SortTransType", 0, HorizontalAlignment.Left); //Add "All Trans Types" option ListViewItem listItem = new ListViewItem("ALL TYPES"); listItem.Name = ""; lstTransTypes.Items.Add(listItem); //Add results from TransTypes query for (int i = 0; i < tmpArray.Length; i++) { String[] cols = tmpArray[i].Split('\t'); if (cols.Length == 2) { listItem = new ListViewItem(cols[1]); listItem.Name = cols[0]; lstTransTypes.Items.Add(listItem); } } lstTransTypes.EndUpdate(); }