Link to home
Start Free TrialLog in
Avatar of mlg74
mlg74

asked on

For loop only displays last item

I have a for loop and it shows the last item only in listbox. I would like it to show all items. Is there a basic reason, why it would only display the last item?

Dim Flipper As String
For x As Integer = 0 To EngineContext.Current.Resolve(Of IWorkContext)().CurrentCustomer.CustomerRoles().Count - 1
        Flipper = EngineContext.Current.Resolve(Of IWorkContext)().CurrentCustomer.CustomerRoles(x).Name
        
    Next

ListBox1.DataSource = Flipper.ToString()
ListBox1.DataBind()

Open in new window

SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial