473,498 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Editor grayed out in PropertyGrid

I have class that also uses a custom editor that, when compiled directly into
my project, works just fine in a propertygrid. However, it was necessary to
place that class into a DLL, hense the editor was also moved into the DLL and
compiled. The issue I have is the the editor is now inactive. Can someone
tell me why this may be?

Here is the code for the property in my class that uses the editor. This
code resides within the DLL.

/// <summary>
/// This is the core WMI data that is being checked.
/// </summary>
[Description("Inspects WMI data on the system."),
Category("Data")
Editor(typeof(TestingWmi.MyWMIEditor),typeof(Syste m.Drawing.Design.UITypeEditor)),
DefaultValue(null), Browsable(true)]
public TestingWmi.WMIData MyWMIData
{
get { return this.wmiData; }
set { this.wmiData = value; }
}

The following code instanciates an instance of the class (which references
the editor) within this dll. This method exists within my main program.

public object CreateClassInstance(Assembly dllAssembly, string strType)
{
// Get a reference to the default constructor.
System.Type componentType = dllAssembly.GetType(strType);
if (componentType != null)
{
// Get the default constructor for this derived class of
PropertyBase.
ConstructorInfo constructorInfoObj =
componentType.GetConstructor(Type.EmptyTypes);
// Invoke the constructor.
object cinfo = constructorInfoObj.Invoke(null);
return cinfo;
}

return null;
}

I'd like to understand why the editor, when called from within the DLL is
inactive, but when called directly from within the code, it is active.

--
Steve
Nov 17 '05 #1
1 2886
I found that by changing the following piece of code that the editor now
picks up.

Editor("TestingWmi.MyWMIEditor",typeof(System.Draw ing.Design.UITypeEditor)),

Instead of using the typeof(...) I used the string reference to the editor.
Does anyone understand why this would make a difference?

--
Steve
"Steve Teeples" wrote:
I have class that also uses a custom editor that, when compiled directly into
my project, works just fine in a propertygrid. However, it was necessary to
place that class into a DLL, hense the editor was also moved into the DLL and
compiled. The issue I have is the the editor is now inactive. Can someone
tell me why this may be?

Here is the code for the property in my class that uses the editor. This
code resides within the DLL.

/// <summary>
/// This is the core WMI data that is being checked.
/// </summary>
[Description("Inspects WMI data on the system."),
Category("Data"),
Editor(typeof(TestingWmi.MyWMIEditor),typeof(Syste m.Drawing.Design.UITypeEditor)),
DefaultValue(null), Browsable(true)]
public TestingWmi.WMIData MyWMIData
{
get { return this.wmiData; }
set { this.wmiData = value; }
}

The following code instanciates an instance of the class (which references
the editor) within this dll. This method exists within my main program.

public object CreateClassInstance(Assembly dllAssembly, string strType)
{
// Get a reference to the default constructor.
System.Type componentType = dllAssembly.GetType(strType);
if (componentType != null)
{
// Get the default constructor for this derived class of
PropertyBase.
ConstructorInfo constructorInfoObj =
componentType.GetConstructor(Type.EmptyTypes);
// Invoke the constructor.
object cinfo = constructorInfoObj.Invoke(null);
return cinfo;
}

return null;
}

I'd like to understand why the editor, when called from within the DLL is
inactive, but when called directly from within the code, it is active.

--
Steve

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2348
by: m. pollack. | last post by:
Hi all, Is there any information to be had about the "Object Collection Editor" that appears when you click on a collection property in the PropertyGrid control? I have a class that maintains a...
2
1761
by: Steve Teeples | last post by:
Is there a way to pull up a windows registry editor within the propertygrid? I only want to look at the keys and values, not change them. -- Steve
2
3019
by: Luis Arvayo | last post by:
Is there some way to attach an editor to a property of a class at runtime ? Ex.; public class MyClass { public int BitmapIndex
2
3788
by: Steve Teeples | last post by:
I have looked but can't find a way to pull up the registry editor within a propertygrid. Is this possible? If so, can you tell me how? -- Steve
0
1632
by: Victoria | last post by:
Setting the Editor attribute for a property which is to be displayed in a PropertyGrid does not work. Instead of displaying a custom editor the PropertyGrid field appears disabled. I have tried...
1
3779
by: Ron M. Newman | last post by:
Hi, Simple imaginary problem: 1) I have a class with three integers in it. 2) An object of this class is a member of a class I will submit to a propertygrid 3) I want to have a custom dialog...
3
1935
by: Brannon | last post by:
So when you use VS's View Designer, each object included is keyed off its Name. You cannot make the name the same as some other component. You can change the name in a PropertyGrid. I want to do a...
4
5427
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
1661
by: michelqa | last post by:
I'm looking for a way to display a string collection where each element of the collection have some properties. By example : MyCollectionItem0 MyPropertyA MyPropertyB MCollectionItem1...
0
7126
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
7005
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...
0
7168
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,...
1
6891
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...
0
5465
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,...
1
4916
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
3096
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
1424
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 ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.