Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bind ListBox To Generic Collection Of Classes
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01454830
Message ID:
01454888
Views:
32
>>>I have a generic List of objects. It is possbile to bind this list to a Listbox?
>>
>>Winforms? Sure.
ListBox1.DataSource = theList;
>>ListBox1.DisplayMember = "ListPropertyName";
>
>Sorry, this is a web app. Can it be done here too?

Pretty much the same:
ListBox1.DataSource = theList;
ListBox1.DataTextField = "ListPropertyName";
ListBox1.DataValueField = "ListPropertyName";
ListBox1.DataBind();
Previous
Reply
Map
View

Click here to load this message in the networking platform