473,226 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

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 6020

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Terry | last post by:
I have a very basic program, but for some reason I can't get it to behave properly. What I want is a basic form with a TabControl that fills the entire form. The tab control should have 4 tabs...
3
by: Marek Wasilewski | last post by:
Hi I have an object whose properties are exposed in a property grid using the usual method: _propertyGrid.SelectedObject = objMain; However, what I want to do is for the property grid to also...
2
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property....
0
by: ljlevend | last post by:
I need to create TypeConverters for the floating type drawing structures (i.e., PointF, SizeF and RectangleF) that behave exactly as their integer couterparts (e.g., System.Drawing.PointConverter)....
8
by: ljlevend2 | last post by:
If a property's type is an array and the property is exposed in a PropertyGrid, then the property can be expanded so that the user can view and edit the array elements. But, I've noticed that if...
0
by: Neo | last post by:
Is there a way to override which Typeconverters and Editors get used in a property grid without changing the object definitions. For Instance there is a class in a library that I cannot change...
0
by: James Arnold | last post by:
Is it possible to reset all the GridItems within a PropertyGrid to be reset, without recursively looping through each item? I know of PropertyGrid.ResetSelectedProperty, but doesn't this mean I'd...
0
by: Sparky74 | last post by:
I have a number of Int32 properties that I want to display in a PropertyGrid control. The problem I have is that I want to be able to bypass the framework's default validation. If you have an Int32...
4
by: Rohan | last post by:
I need to use the Collection editor of the propertyGrid, but i can't this to work, i looked around on the NET on collection and I am kinda lost. i have this so far, i don't know what i should do...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.