Hi,

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:

<Bindable(True)> _
Public Property Items() As ListItemCollection
Get
Return ViewState("AddToList")
End Get

Set(ByVal value As ListItemCollection)
ViewState("AddToList") = value
listbox1.DataSource = value
listbox1.DataBind()
End Set
End Property

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.