Thanks for your answer !!
I'm now hidding some properties with an implementation of ITypeDescriptorFilterService. I try to do the same with the (Name) property but I can't.
The components i use are the microsoft controls (buttons, textboxes, etc.). I don't have usercontrols.
I've a PropertyGrid to show the selected control properties. The first problem I'd, was that the "Name" property didn't appeared, so I'd to implement the IExtenderListService interface in this way:
#region
IExtenderListService Members
public IExtenderProvider[] GetExtenderProviders()
{
if (extenderProviders == null)
{
extenderProviders = new ArrayList();
}
IExtenderProvider[] e = new IExtenderProvider[extenderProviders.Count];
extenderProviders.CopyTo(e, 0);
return e;
}
#endregion
serviceContainer.AddService(
typeof(IExtenderListService), this);
With this simple implementation the "(Name)" property appeared. This would be fine, but the problem was that if I've a TextBox control called "TextBox1" and a TextBox control called "Textbox2", When I change the name of one of this control and put the same name as the other, the designer didn't thrown any kind of exception.
I'm still don't know why.
So I created a custom property called Name the same as the DesignerHosting sample have. Then the "Name" property appeared 2 times in the PropertyGrid.
If I can make that the "Name" property (that appears automatically when I implements IExtenderListService) validates the text of the names of the controls, it would be greate !!
The other solution is hide the automatic property name, so only my custom property name appears in the propertygrid.
Can you help me with this ?
Thanks a lot.
Gabriel