LiLo
03-07-2006, 09:52 AM
Hi,
I have a webparts control containing an Asp.net listbox and a label. There is this public property called 'ListItems' which will appear in the properties window when the control is selected on the design page in VS 2005.
When the "ListItems" property is selected, the ListItemsCollection Editor window pops up and the user can add new list items. However, when the ok button is clicked, the listbox doesnt display the list items.
Below is a code snippet of the ListItems public property:
<EditorAttribute(GetType
System.Web.UI.Design.WebControls.ListItemsCollectionEditor), _
GetType(UITypeEditor))> _
Public ReadOnly Property Items() As ListItemCollection
Get
listbox1.DataSource = listitems
listbox1.DataBind()
Return listitems
End Get
End Property
How to link the list collection to the listbox for display?
I have a webparts control containing an Asp.net listbox and a label. There is this public property called 'ListItems' which will appear in the properties window when the control is selected on the design page in VS 2005.
When the "ListItems" property is selected, the ListItemsCollection Editor window pops up and the user can add new list items. However, when the ok button is clicked, the listbox doesnt display the list items.
Below is a code snippet of the ListItems public property:
<EditorAttribute(GetType
System.Web.UI.Design.WebControls.ListItemsCollectionEditor), _
GetType(UITypeEditor))> _
Public ReadOnly Property Items() As ListItemCollection
Get
listbox1.DataSource = listitems
listbox1.DataBind()
Return listitems
End Get
End Property
How to link the list collection to the listbox for display?