468,771 Members | 1,637 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,771 developers. It's quick & easy.

PropertyGrid Reset Typeconverters

I have a PropertyGrid (Windows Forms App) based component that uses
TypeConverters to generate ranges of acceptable values for properties. The
idea was that I could download the key/value pairs from a database and
manipulate the TypeConverters dynamically. The property grid then displays
the property with a drop down list.

It does work when I open the application for the first time. If, however, I
open the form and then open a second form and change some data; the new data
is not reflected in the drop down lists when I return to the first form.
The only way to reset the typeconverters is to close the application and
restart it.

I'm guessing, but it appears that the PropertyGrid holds some static
collection of class/properties and typeconverters. Also, it appears that it
is initialized the first time that an instance of a class is designated as a
PropertyGrid instance's SelectedObject. What I need however is the ability
to reinitialize the typeconverters when required. Does anybody know how to
do this?

Thank you,
Dave Girvitz, MCAD
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 07/18/2003
Nov 15 '05 #1
3 5742

Hi Dave,

I think you must save the data you have changed in the second form to the
database.
Then you should use some way to make the first form to reload the data in
the database.

Maybe you can put a "reload" button in the form which can reload the data.
Also, you can register certain message to windows to inform all the
instance of you application
to update data after your change.

Hope this helps.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Dave Girvitz" <dg******@hotmail.com>
| Subject: PropertyGrid Reset Typeconverters
| Date: Fri, 25 Jul 2003 13:49:16 -0600
| Lines: 29
| 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: <eA**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: h68-146-48-175.cg.shawcable.net 68.146.48.175
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:171900
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I have a PropertyGrid (Windows Forms App) based component that uses
| TypeConverters to generate ranges of acceptable values for properties.
The
| idea was that I could download the key/value pairs from a database and
| manipulate the TypeConverters dynamically. The property grid then
displays
| the property with a drop down list.
|
| It does work when I open the application for the first time. If,
however, I
| open the form and then open a second form and change some data; the new
data
| is not reflected in the drop down lists when I return to the first form.
| The only way to reset the typeconverters is to close the application and
| restart it.
|
| I'm guessing, but it appears that the PropertyGrid holds some static
| collection of class/properties and typeconverters. Also, it appears that
it
| is initialized the first time that an instance of a class is designated
as a
| PropertyGrid instance's SelectedObject. What I need however is the
ability
| to reinitialize the typeconverters when required. Does anybody know how
to
| do this?
|
| Thank you,
| Dave Girvitz, MCAD
|
|
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.502 / Virus Database: 300 - Release Date: 07/18/2003
|
|
|

Nov 15 '05 #2

Hi Dave,

I do not quite understand your problem, if you have time, I'd like to see
your mocking up.

Thanks

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Dave Girvitz" <dg******@hotmail.com>
| References: <eA**************@TK2MSFTNGP09.phx.gbl>
<iw**************@cpmsftngxa06.phx.gbl>
| Subject: Re: PropertyGrid Reset Typeconverters
| Date: Thu, 31 Jul 2003 11:27:58 -0600
| Lines: 103
| 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: <#T*************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: h68-146-48-175.cg.shawcable.net 68.146.48.175
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:173341
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Dear Jeffery,
| This does not appear to be the problem. The actual data for the
| TypeConverter is held by a separate class that has a static dataset as
| property. I know the dataset is being updated properly. My actual usage
is
| scheduler. The form in question holds 2 property grids, represent a 2 day
| span. The selected object has 24 properties (the hours of the day) that
use
| the my TypeConverter. When I load an object into each of the property
grid,
| I know that the constructor of the typeconverter fires 24 times. Nothing
I
| do can get the constructor to refire. This is why I think the initiation
| process is handled by private static methods that somehow access
information
| about a class. It also appears that this information is stored in some
sort
| of collection and is never updated. If you like, I can do a mock up of the
| code to illustrate the problem.
|
| Dave
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:iw**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Dave,
| >
| > I think you must save the data you have changed in the second form to
the
| > database.
| > Then you should use some way to make the first form to reload the data
in
| > the database.
| >
| > Maybe you can put a "reload" button in the form which can reload the
data.
| > Also, you can register certain message to windows to inform all the
| > instance of you application
| > to update data after your change.
| >
| > Hope this helps.
| >
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Dave Girvitz" <dg******@hotmail.com>
| > | Subject: PropertyGrid Reset Typeconverters
| > | Date: Fri, 25 Jul 2003 13:49:16 -0600
| > | Lines: 29
| > | 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: <eA**************@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: h68-146-48-175.cg.shawcable.net 68.146.48.175
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:171900
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | I have a PropertyGrid (Windows Forms App) based component that uses
| > | TypeConverters to generate ranges of acceptable values for properties.
| > The
| > | idea was that I could download the key/value pairs from a database and
| > | manipulate the TypeConverters dynamically. The property grid then
| > displays
| > | the property with a drop down list.
| > |
| > | It does work when I open the application for the first time. If,
| > however, I
| > | open the form and then open a second form and change some data; the
new
| > data
| > | is not reflected in the drop down lists when I return to the first
form.
| > | The only way to reset the typeconverters is to close the application
and
| > | restart it.
| > |
| > | I'm guessing, but it appears that the PropertyGrid holds some static
| > | collection of class/properties and typeconverters. Also, it appears
| that
| > it
| > | is initialized the first time that an instance of a class is
designated
| > as a
| > | PropertyGrid instance's SelectedObject. What I need however is the
| > ability
| > | to reinitialize the typeconverters when required. Does anybody know
how
| > to
| > | do this?
| > |
| > | Thank you,
| > | Dave Girvitz, MCAD
| > |
| > |
| > | ---
| > | Outgoing mail is certified Virus Free.
| > | Checked by AVG anti-virus system (http://www.grisoft.com).
| > | Version: 6.0.502 / Virus Database: 300 - Release Date: 07/18/2003
| > |
| > |
| > |
| >
|
|
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.502 / Virus Database: 300 - Release Date: 07/18/2003
|
|
|

Nov 15 '05 #3
Jeffrey, Dave,

The problem seems to be in that the TypeConverters have no chance to find
out when they should refresh their lists of valid property values. I think a
some notification mechanism should be introduced (kind of the Observer GoF
pattern, emplpoying standard framework events) and when the user modifes
data in the second form, an event is raised and all interested subscribers
(that is, TypeConverter instances) refresh their data.

I unfortunately cannot advise anything about the PropertyGrid caching, as I
have never dealt with this control. I would suggest though looking for an
article in the May or June issue of MSDN Magazine where righ design features
for custom user controls are described. I think Dave might find some useful
info about behind-the-scenes details of the TypeConverters and the property
editor.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

"Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
news:Av**************@cpmsftngxa06.phx.gbl...

Hi Dave,

I do not quite understand your problem, if you have time, I'd like to see
your mocking up.

Thanks

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Dave Girvitz" <dg******@hotmail.com>
| References: <eA**************@TK2MSFTNGP09.phx.gbl>
<iw**************@cpmsftngxa06.phx.gbl>
| Subject: Re: PropertyGrid Reset Typeconverters
| Date: Thu, 31 Jul 2003 11:27:58 -0600
| Lines: 103
| 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: <#T*************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: h68-146-48-175.cg.shawcable.net 68.146.48.175
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:173341 | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Dear Jeffery,
| This does not appear to be the problem. The actual data for the
| TypeConverter is held by a separate class that has a static dataset as
| property. I know the dataset is being updated properly. My actual usage is
| scheduler. The form in question holds 2 property grids, represent a 2 day | span. The selected object has 24 properties (the hours of the day) that
use
| the my TypeConverter. When I load an object into each of the property
grid,
| I know that the constructor of the typeconverter fires 24 times. Nothing I
| do can get the constructor to refire. This is why I think the initiation | process is handled by private static methods that somehow access
information
| about a class. It also appears that this information is stored in some
sort
| of collection and is never updated. If you like, I can do a mock up of the | code to illustrate the problem.
|
| Dave
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:iw**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Dave,
| >
| > I think you must save the data you have changed in the second form to
the
| > database.
| > Then you should use some way to make the first form to reload the data
in
| > the database.
| >
| > Maybe you can put a "reload" button in the form which can reload the
data.
| > Also, you can register certain message to windows to inform all the
| > instance of you application
| > to update data after your change.
| >
| > Hope this helps.
| >
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Dave Girvitz" <dg******@hotmail.com>
| > | Subject: PropertyGrid Reset Typeconverters
| > | Date: Fri, 25 Jul 2003 13:49:16 -0600
| > | Lines: 29
| > | 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: <eA**************@TK2MSFTNGP09.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: h68-146-48-175.cg.shawcable.net 68.146.48.175
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:171900
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | I have a PropertyGrid (Windows Forms App) based component that uses
| > | TypeConverters to generate ranges of acceptable values for properties. | > The
| > | idea was that I could download the key/value pairs from a database and | > | manipulate the TypeConverters dynamically. The property grid then
| > displays
| > | the property with a drop down list.
| > |
| > | It does work when I open the application for the first time. If,
| > however, I
| > | open the form and then open a second form and change some data; the
new
| > data
| > | is not reflected in the drop down lists when I return to the first
form.
| > | The only way to reset the typeconverters is to close the application
and
| > | restart it.
| > |
| > | I'm guessing, but it appears that the PropertyGrid holds some static
| > | collection of class/properties and typeconverters. Also, it appears
| that
| > it
| > | is initialized the first time that an instance of a class is
designated
| > as a
| > | PropertyGrid instance's SelectedObject. What I need however is the
| > ability
| > | to reinitialize the typeconverters when required. Does anybody know
how
| > to
| > | do this?
| > |
| > | Thank you,
| > | Dave Girvitz, MCAD
| > |
| > |
| > | ---
| > | Outgoing mail is certified Virus Free.
| > | Checked by AVG anti-virus system (http://www.grisoft.com).
| > | Version: 6.0.502 / Virus Database: 300 - Release Date: 07/18/2003
| > |
| > |
| > |
| >
|
|
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.502 / Virus Database: 300 - Release Date: 07/18/2003
|
|
|


Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Terry | last post: by
3 posts views Thread by Marek Wasilewski | last post: by
reply views Thread by James Arnold | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.