RE: PropertyGrid Contol localized DisplayName by v-yiy
v-yiy
Wed Oct 29 07:43:20 CST 2003
Hi,
I apologize for the long delay, I wrote a small program to repro your
problem.
but unfortunately, this problem didn't occurred on my machine when I just
returns a string object.
Does this problem still exists if the DisplayName property of your derived
propertydescriptor only returns a string?
If this works , could you show me some snippet of your PropertyDescriptor
class?
If you have any updates to this problem , please let me know.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!
--------------------
| From: <nospam@datgroup.com>
| Subject: PropertyGrid Contol localized DisplayName
| Date: Fri, 24 Oct 2003 16:12:33 +0100
| Lines: 42
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#F2z3FkmDHA.2416@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| NNTP-Posting-Host: no-dns-yet.demon.co.uk 195.173.8.133
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:55186
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| I'm Using the PropertyGrid Contol , and have a requirement to display a
| localized property name.
|
| Therefore My Classes Implement ICustomTypeDescriptor, and return a custom
| PropertyDescriptor Collection,
|
| The issues is that in the Derived PropertyDescriptor object when
overriding
| the "DisplayName" property it causes the PropertyGrid to call the
| "DisplayName" Property an inordinate number of times, which then makes the
| PropertyGrid, very slow and unusable.
|
| code Snippet
|
| ICustomTypeDescriptor.
|
| public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
|
| .Returns new PropertyDescriptorCollection containing MyPropertyDescriptor
| objects
|
| }
|
| public class MyPropertyDescriptor : PropertyDescriptor
|
| public override string DisplayName {
|
| get{return "Overriden DisplayName"}
|
| }
|
| Worth mentioning, if I comment out the DisplayName Override Property
|
| And run the code, then the grid functions as usual?
|
| Any one have any idea's why DisplayName gets called again and again, and
how
| to prevent it?
|
| Cheers
|
| Brett
|
|
|