473,406 Members | 2,954 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,406 software developers and data experts.

Derived class of StringCOnverter for dynamic propertygrid

Hi,

I am trying to use, public class FileNameConverter : StringConverter
for creating a dropdown list within my dynamic property grid. Thus I
have the methods GetStandardValuesSupported, GetStandardValues, and
GetStandardValuesExclusive.

My problem is , that my GetStandardValues, needs to get values from a
database, whose name I need to pass from another class, how do I go
about doing that??

I would also need to pass 2 other parameters. And I am never calling
the class by its constructor.
The only time the class name gets passed is like this:

myProp = new PropertySpec(attribute, typeof(string), category,
description, valueofattribute,
typeof(System.Drawing.Design.UITypeEditor),
typeof(FileNameConverter));

where PropertySpec is my dynamic propertygrid class.

Please help.

Thanks alot!

Jul 20 '07 #1
1 3600
At /best/, you have a context (ITypeDescriptorContext) instance
available to you. This gives you access to the containing instance
(Component) and property. For complex scenarios, the trick is to make
your converter be able to read any values it needs from the containing
instance. You can cast to this - if it isn't provided, or isn't
something you expect, then fail safe.

As a side node, I would have thought the popup approach might have
worked better for this type of thing...

Marc

Jul 20 '07 #2

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

Similar topics

6
by: Abhijit Deshpande | last post by:
Is there any elegant way to acheive following: class Base { public: Base() {} virtual ~Base() {} virtual void Method() { cout << "Base::Method called"; return; } };
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
1
by: ypjofficial | last post by:
Dear All, According to OOPs , a base class pointer can to point to derived class object....call this as fact1 But somehow I am not comfortable while understanding this concept. The explanaition...
8
by: Gonçalo Rodrigues | last post by:
Hi all, I have a template class (call it Object) whose instances have a variable size part - an array of of T objects. But this variable size part is fixed at creation time so instead of...
8
by: Manuel | last post by:
Hi! If I've a vector filled with abstract classes, can I push in it the derived classes too? Even if derived classes have new methods? I've done some experiments, and it seem I can push the...
3
by: Marek | last post by:
Hi I have a class which has a property which implements IDictionary which I would like to display in a propertygrid control. If I add the property expands, but I only get Count, IsReadOnly,...
2
by: =?Utf-8?B?TWF1cmljZU0=?= | last post by:
Hi all, how can I hide a property in a derived class in a propertygrid. Let's say I have a classX and a derived classY. A property in classX will be visible in the propertygrid but the same...
12
by: subramanian100in | last post by:
Suppose class Base { public: virtual ~Test() { ... } // ... }; class Derived : public Base
6
by: Christopher | last post by:
I've seen various ways of doing this, but what I want is to be able to take a base class pointer and know which derived class to cast to. For example I am going to make a base light class, that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...
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...

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.