Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
03-06-2006, 07:41 AM #1
- Join Date
- Feb 2006
- Thanked 0 Times in 0 Posts
How to add a list item collection property?
I am creating a webparts control which consists of a listbox and a label. How do we add the 'items' property to the listbox such that when the webparts control is used during design time,the user can add listitems to the listbox at design time using the properties window? (similar to adding items to vb's listbox during design time)
Below is the code snippet:
Public Property Items() As ListItemCollection
Set(ByVal value As ListItemCollection)
ViewState("AddToList") = value
listbox1.DataSource = value
When the control is dragged onto the form, the List Item Collection Editor window pops ups when I click on the items property. However, after adding list items and clicking the 'ok' button, nothing appears in the listbox. The listitems are not stored.