473,651 Members | 2,582 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with PropertyGrid

30 New Member
Hi,
I am basically a VC++ developer but now working on C#.
I am having a assembly in that i have added a UserControl and on that UserControl I am having a tree-view control and Property Grid control. As and when user selects the different nodes I am populating the corresponding properties in that grid. For the normal properties its working perfectly. But when I have to choose the property from the drop-down list. Its creating the problem. Whenever I click on the drop-down arrow nothing happens.
So I created a test application. Took a windows form application added property grid, added a class deriving it from StringConverter . Everything works fine in test application. But I don't know why its failing in my production code.
I debugged both codes. In test application whenever I click on the drop-down arrow call is coming inside <i>GetStandardV alues</i> function. But this is not happening in my main code, its not hitting the break-point at all.

Can anybody tell me why this is happening, Where I am going wrong?
the test application code is below. The exact code is present in my main code

namespace PropertyPage
{
class MyProperties:St ringConverter
{
private double str1;
private string str2;
private string str3;

public override bool GetStandardValu esSupported(ITy peDescriptorCon text context)
{
//return base.GetStandar dValuesSupporte d(context);
return true;
}
public override bool GetStandardValu esExclusive(ITy peDescriptorCon text context)
{
//return base.GetStandar dValuesExclusiv e(context);
return true;
}
public override StandardValuesC ollection GetStandardValu es(ITypeDescrip torContext context)
{
return new StandardValuesC ollection(new string[] { "Entry1", "Entry2", "Entry3" });
}

[CategoryAttribu te("Task "), DescriptionAttr ibute("test"), TypeConverter(t ypeof(MyPropert ies))]
public string Str3
{
get { return str3; }
set { str3 = value; }
}
[CategoryAttribu te("Task "), DescriptionAttr ibute("test"), ReadOnly(true)]
public double Str1
{
get { return str1; }
set { str1 = value; }
}
[Editor(typeof(S ystem.Windows.F orms.Design.Fol derNameEditor), typeof(System.D rawing.Design.U ITypeEditor))]
public string Str2
{
get { return str2; }
set { str2 = value; }
}
}
}

I am initializing the grid as

private void Form1_Load(obje ct sender, EventArgs e)
{
MyProperties my = new MyProperties();
my.Str1 = 12;
propertyGrid1.S electedObject = my;
}

I have observed similar behavior with Str2 Property. Its not allowing me to set the path in my main code but in test application its doing its job.
Apr 6 '09 #1
0 1205

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2892
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.
1
6440
by: Terry | last post by:
I created a collection derived from CollectionBase that is just made up of strings, called "StringList". I have another object that has as a member one of these StringList. If I assign that object to a PropertyGrid, click on the collection editor "..." and try to add a new string, I get an error message "Constructor on type System.String not found.". Any ideas what I'm missing? If it can't create a new object of one of the built-in...
2
3972
by: Mevar81 | last post by:
Hi to everybody.I have a problem with the PropertyGrid control.I want to display not all the properties of a generic Control(Button,TextBox,ComboBox,ecc.).In general I don't want to display only one category(Appearance, Behavior,ecc.) but I want to chose directly which properties to show.I've read that I can use the SelectedObjects to put an array of object with some properties in common with the SelectedObject,and only properties in...
1
11870
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few samples of how to use the PropertyGrid control and have gained a decent understanding of it. But of course, as it usually the case, my needs go far beyond the simple examples shown in online samples. All the online samples show how to take a class...
7
9707
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
6
6931
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
5
15330
by: Sharon | last post by:
I'm using the PropertyGrid control, and I want it to show a button. But I set the PropertyGrid.SelectedObject with a object that as a Button property, the PropertyGrid shows the buttons properties, and I want the button to be shown as drawn and clickable button. How can I do that? -- Thanks Sharon
3
1947
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 similar thing. I have a class (MissionManager with a bunch of static functions) that contains a static KeyedCollection<Missionof my objects. Each mission has a Name (and interface requring the name). That works fine. What doesn't work is changing...
3
4348
by: =?Utf-8?B?U3RldmVU?= | last post by:
Is it possible to hide a row within a PropertyGrid based upon the boolean value of another row within the PropertyGrid? I am using VS2005 with .NET Frameworks 2.0. -- ----------- Thanks, Steve
8
2997
by: alexcsharp2 | last post by:
Hello. I created a designer in c#. Everything is working excepted the property grid. I want to show only the properties I added. So I created a class which inherits of a button. And I added properties. But I want to filter the base properties. So to do this, I inherit my class from ICustomTypeDescriptor.
0
8347
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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
8571
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7294
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
6157
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
5605
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
4143
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...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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

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.