CollectionEditor weird behavior

A

A.J. van der Burg

Hi all,

I'm working on a custom tab control, which has a custom collection type,
which is a collection of Control classes. When editing a property of an item
in the collection, fore example the ID property, everything works fine until
I switch from Design view to Html view. The adjusted ID is suddenly also set
on the parent control. I tried several designer attributes to solve this, but
without any result. Could somebody shed some light on this?

TIA,

Arnold Jan van der Burg
 
A

A.J. van der Burg

Hi,

I've already found the source of error. It appeared that my Designer class
(which uses some eventhandlers for disabling/enabling verbs) had faulty code
in the Initialize() method. I did a call to the base.Initialize(component)
function before adding the eventhandlers. After switching this around, all
problems were solved (see code beneath).

base.Initialize(component);
ss = (ISelectionService) this.GetService(typeof(ISelectionService));
ccs = (IComponentChangeService)
this.GetService(typeof(IComponentChangeService));

if (ss != null)
{
ss.SelectionChanged += new EventHandler(OnSelectionChanged);
ccs.ComponentChanged += new
ComponentChangedEventHandler(OnComponentChanged);
}

Arnold Jan van der Burg
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top