This is a migrated thread and some comments may be shown as answers.

ArrayList to ListBox DataValueField

1 Answer 36 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Allan asked on 14 Aug 2012, 05:18 PM

I need some assistance as to how can I assign the DataValueField Value using the code below.
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    'Dim UserName As String = Request.QueryString("UserName")
    Dim UserName As String = "Test"
    lbl_UserName.Text = UserName
    If Not IsPostBack Then
        Dim results As New ArrayList()
        Dim context As New PrincipalContext(ContextType.Domain, "Fred_NT")
        Dim p As UserPrincipal = UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, UserName)
        Dim groups = p.GetAuthorizationGroups()
        For Each group In groups
        rlb_MemberGroups.DataValueField = ????????
        rlb_MemberGroups.DataSource = results
    End If
    Label1.Visible = False
End Sub

Thanks as always.

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 15 Aug 2012, 11:43 AM
Hello Alan,

When binding the RadListBox to an ArrayList the value of the items should be the same as text assigned to the items. An example of binding to an ArrayList is shown in the following help article:

I hope it will help.

the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Top achievements
Rank 2
Answers by
Telerik team
Share this question