In a previous posting (thread) I was creating a small datagridview (dgv) with one column from Active Directory. This time I am trying to use an existing data bound dgv and add a similar column to it. With the code below I am able to add the column, but no data is loaded into it. What am I missing?
Code:
dgvCODView.DataSource = PWordRstTableAdapter.FillBySubmitted(Me.MedSARADataSet.PWordRst)
Dim extraColumn As New DataGridViewColumn
With extraColumn
.Name = "UserName"
.HeaderText = "User Name"
.ReadOnly = True
End With
dgvCODView.Columns.Insert(0, extraColumn)
For Each row As DataGridViewRow In dgvCODView.Rows
row.Cells("UserName") = GetUserName(domainDN, row.Cells("EmpID"))
Next