M
mharness
Hello,
Under most circumstances I don't have any trouble removing items from a
dropdownlist but this time it's not working.
I have a ddl that list items which, when choosen are added to a gridview on
the same page and removed from the ddl so that they can only be added once.
What I want to do and can't seem to make work is the code that removes the
ddl items that are already on the gridview at page load.
str value below is a valid item in the ddl.
Thanks,
Mike
Protected Sub CullProjects()
'from ddlProjects that are already in gvRequestProjects
Dim row As GridViewRow
If Me.gvRequestProjects.Rows.Count > 0 Then
For Each row In Me.gvRequestProjects.Rows
Dim str As String = CType(row.FindControl("ProjectName"),
LinkButton).Text
Me.ddlProjects.Items.Remove(str)
Next
End If
End Sub
Under most circumstances I don't have any trouble removing items from a
dropdownlist but this time it's not working.
I have a ddl that list items which, when choosen are added to a gridview on
the same page and removed from the ddl so that they can only be added once.
What I want to do and can't seem to make work is the code that removes the
ddl items that are already on the gridview at page load.
str value below is a valid item in the ddl.
Thanks,
Mike
Protected Sub CullProjects()
'from ddlProjects that are already in gvRequestProjects
Dim row As GridViewRow
If Me.gvRequestProjects.Rows.Count > 0 Then
For Each row In Me.gvRequestProjects.Rows
Dim str As String = CType(row.FindControl("ProjectName"),
LinkButton).Text
Me.ddlProjects.Items.Remove(str)
Next
End If
End Sub