473,748 Members | 7,608 Online
Bytes | Software Development & Data Engineering Community
+ 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 6049

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******@hotma il.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.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: h68-146-48-175.cg.shawcabl e.net 68.146.48.175
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1719 00
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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******@hotma il.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.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: h68-146-48-175.cg.shawcabl e.net 68.146.48.175
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1733 41
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.mi crosoft.com> wrote in message
| news:iw******** ******@cpmsftng xa06.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******@hotma il.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.publi c.dotnet.langua ges.csharp
| > | NNTP-Posting-Host: h68-146-48-175.cg.shawcabl e.net 68.146.48.175
| > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| > | Xref: cpmsftngxa06.ph x.gbl
| microsoft.publi c.dotnet.langua ges.csharp:1719 00
| > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.mi crosoft.com> wrote in message
news:Av******** ******@cpmsftng xa06.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******@hotma il.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.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: h68-146-48-175.cg.shawcabl e.net 68.146.48.175
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1733 41 | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.mi crosoft.com> wrote in message
| news:iw******** ******@cpmsftng xa06.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******@hotma il.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.publi c.dotnet.langua ges.csharp
| > | NNTP-Posting-Host: h68-146-48-175.cg.shawcabl e.net 68.146.48.175
| > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| > | Xref: cpmsftngxa06.ph x.gbl
| microsoft.publi c.dotnet.langua ges.csharp:1719 00
| > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
2895
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 with a single PropertyGrid control on each tab that fills it's parent's tab page's client area. Here's what I did. 1. Create a new project.
3
2273
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 display the properties of an object (objMainMember) which is defined as a property of the first object (objMain), thereby getting all of the properties for the objMain and objMainMember objects in one SelectedObject assignment.
2
4840
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. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value In order to indicate if a property should be serialized you can include a boolean function named...
0
306
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). I am able to create TypeConverters with basic functionality by inheriting from System.ComponentModel.ExpandableObjectConverter and overriding CanConvertTo, CanConvertFrom, ConvertTo and ConvertFrom. But, the integer converts also implement the...
8
5231
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 the property is ReadOnly then the expanded array elements can still be edited. I need to make the elements ReadOnly if the property is ReadOnly. Is this possible? Thank you, Lance
0
984
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 that has somehting like a color property. It would be great if there was a callback for when the property grid was going to display that property that I could replace the standard colro editor with my own editor.
0
1218
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 have to select each item individually and reset it? Also, is it possible to deselect the current property? I tried using PropertyGrid.SelectedGridItem = Nothing, but it throws an error. Thank you
0
1210
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 property, delete the text within the propertygrid cell, then the default validation error window appears. I want to modify the value to zero if no value is entered. I notice that the ConvertTo/ConvertFrom methods return objects.. which Int32...
4
5448
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 next Thank you Public class frmColor Dim xColors As New myColors
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.