Custom asp.net control using collection - Design Time Refresh

P

Patrick

I have a custom asp.net control that uses a collection class to store items.
Properties modified for each item cause the design time window to refresh, I
am using the "ParentNotify" attribute, this works well. I also am using a
composite control designer class that renders the control very well.

My only complaint/question is: how can I refresh the design time surface
when items are added to the collection? The only way to refresh the design
time seems to be changing a property or by recompiling.
 
K

Ken Dopierala Jr.

Hi Jeff,

Check out the Free Ultra Menu at http://OTBTechSystems.Com ,you can download
it from the Features page. The control uses a custom built Editor to update
it's collection. In the code for the Editor you can see where it marks the
collection as dirty and forces VS.Net to update it's design-time view while
you are still in the editor. The code is 100% VB.Net. Good luck! Ken.
 
P

Patrick

Thanks, I checked out that project and I see how it works. However our
control exposes a read only property for the collection.

Is there any other way to notify the design time of changes to the
collection? I also noticed that when collection items are removed they are
not removed from the code behind on the page. I am sure this has something
to do with the notification failing. This causes problems when you
add/remove/ and add collection items again because it orphans declarations
for each item you remove.

Maybe I need to find a way to remove the "readonly" from the property.
Seems like we had some trouble with the collection and viewstate unless it
was read only.
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top