Item Collection Editor doesn't preserve collection

A

Andrés Giraldo

Hi!

I'm trying to create a control that has an item collection property.
Inheriting from a WebControl, my CustomControl Inherits it's base editor
too. It's editor allows to fill the item collection property in design
time, that's ok...

But when I create the items collection and I look into the HTML view at
design time, the Items property is setted to the type of the item
collection property...

<cc1:CustomControl Items="ItemCollection"></cc1:CustomControl>

If I run the form, it doesn't show me any Item of the Collection I've
created before...

Anyone could give me an idea of what's happenning? I'm completely
lost!!!

I don't have any idea of preserving the items collection property at
design time!!!

Thanks a lot!
 
T

Teemu Keiski

Hi,

how have you implemented the property? Is it read-only and does it have
required attributes applied? Like
PersistenceMode(PersistenceMode.InnerProperty), NotifyParentProperty(true)
and DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

Hi!

I'm trying to create a control that has an item collection property.
Inheriting from a WebControl, my CustomControl Inherits it's base editor
too. It's editor allows to fill the item collection property in design
time, that's ok...

But when I create the items collection and I look into the HTML view at
design time, the Items property is setted to the type of the item
collection property...

<cc1:CustomControl Items="ItemCollection"></cc1:CustomControl>

If I run the form, it doesn't show me any Item of the Collection I've
created before...

Anyone could give me an idea of what's happenning? I'm completely
lost!!!

I don't have any idea of preserving the items collection property at
design time!!!

Thanks a lot!
 
A

Andrés Giraldo

Hi!

The declaration for the Item Collection Property is defined like this:

Public ReadOnly Property Items() As TabItemCollection

Thanks for answer!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top