 |
Windows Form PropertyGrid dropdown value - moni |
23-Jul-07 10:07:31
|
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! |
 |
| |
| |
|
| |
|
Windows Form PropertyGrid dropdown value - Bob Powell [MVP] |
26-Jul-07 05:25:39
|
it's not recommended practice AFAIK but you could implement you
TypeConverter as a singleton with a couple of constructors ensuring that
the first time you use it you pass in the connection string.
TypeConverters are usually instantiated, used and killed really quickly.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article. |
 |
| |
Windows Form PropertyGrid dropdown value - Robbe Morris - [MVP] C# |
19-Aug-07 08:12:24
|
You may want to take the approach listed
in the article of my signature.
--
Robbe Morris
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials/aspnet/270e9432-d236-47e7-b1af-5cd3abe27a75/net-propertygrid-control.aspx |
 |
| |
|
|
| Is there any way to prevent ListBox smooth scrolling? |