private void refreshButton_Click(object sender, EventArgs e) { usersListView.Clear(); this.usersListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.idCol, this.firstCol, this.LastCol, this.userCol, this.accessColum }); this.firstCol.Text = "First"; this.firstCol.Width = 100; this.LastCol.Text = "Last"; this.LastCol.Width = 100; this.userCol.Text = "User Name"; this.userCol.Width = 125; this.accessColum.Text = "Access Level"; this.accessColum.Width = 100; this.idCol.Text = "ID"; this.idCol.Width = 25; var users = delUser.populateList(); foreach (var User in users) { string id = User.getUID().ToString(); string first = User.getFirst(); string last = User.getLast(); string userName = User.getUserName(); string level = User.getLevel().ToString(); usersListView.Items.Add(new ListViewItem(new string[] { id, first, last, userName, level })); } }
private void EditUsers_Load(object sender, EventArgs e) { var users = delUser.populateList(); foreach (var User in users) { string id = User.getUID().ToString(); string first = User.getFirst(); string last = User.getLast(); string userName = User.getUserName(); string level = User.getLevel().ToString(); userListView.Items.Add(new ListViewItem(new string[] { id, first, last, userName, level })); } }