public void ddlEvent_Populate() { _EventTable = _TDH.GetEvents(); List<Tuple<int, string>> Events = new List<Tuple<int, string>>(); for (int i = 0; i < _EventTable.Rows.Count; i++) { ComboboxItem item = new ComboboxItem(); item.Text = _EventTable.Rows[i]["Name"].ToString() + " - " + String.Format("{0:MM/dd/yy}", Convert.ToDateTime(_EventTable.Rows[i]["Date"])); item.Value = _EventTable.Rows[i]["ID"].ToString(); ddlEvent.Items.Add(item); } }
private string mUser; //for addEvent functionality #endregion private void ddlTicket_Populate() //Populate combobox with tickets the User has requested to return { _ReturnsTable = _TDH.GetTickets(); for (int i = 0; i < _ReturnsTable.Rows.Count; i++) { ComboboxItem item = new ComboboxItem(); item.Text = _ReturnsTable.Rows[i]["Name"].ToString() + " - " + _ReturnsTable.Rows[i]["TicketNo"].ToString(); item.Value = _ReturnsTable.Rows[i]["TicketNo"].ToString(); comboBox1.Items.Add(item); } }