473,461 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 6030

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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.