M
mharness
Hello,
Any ideas why this code will not remove listitems for the dropdownlist?
Protected Sub CullProjects()
Dim ProjectName As String
If Me.gvRequestProjects.Rows.Count > 0 Then
For Each row As GridViewRow In Me.gvRequestProjects.Rows
ProjectName =
Trim(Me.gvRequestProjects.DataKeys(row.RowIndex).Values(1).ToString)
Me.ddlProjects.Items.Remove(ProjectName)
Next
End If
End Sub
ProjectName is a valid name of an item in the ddl. Using something very
similar to this on a one-by-one basis and it works correctly but not in this
code.
Thanks,
Mike
Any ideas why this code will not remove listitems for the dropdownlist?
Protected Sub CullProjects()
Dim ProjectName As String
If Me.gvRequestProjects.Rows.Count > 0 Then
For Each row As GridViewRow In Me.gvRequestProjects.Rows
ProjectName =
Trim(Me.gvRequestProjects.DataKeys(row.RowIndex).Values(1).ToString)
Me.ddlProjects.Items.Remove(ProjectName)
Next
End If
End Sub
ProjectName is a valid name of an item in the ddl. Using something very
similar to this on a one-by-one basis and it works correctly but not in this
code.
Thanks,
Mike