473,387 Members | 1,844 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,387 software developers and data experts.

Property Grid with Dynamic Property values at runtime

Joe
Hi

I am trying to allow my property grid have a property with the values are
dynamically generated at runtime
I can create a static list but not dynamic

Anyone have a suggestion or code sample on how to do this ??

Thanks

namespace MyReport{

class MyPropGrid

{

private string sTitle1 = "";

private string sTitle2 = "";

private string sLogo = "";

private int nTitleFontSz = 0;

private System.Drawing.Color cBackColor;

private bool bFreeze = true;

private bool bAlternateRow = true;

private System.Drawing.Color cAltRowColor;

private string _myProp = "entry1";

[Browsable(true)]

[DefaultValue("entry1")]

[CategoryAttribute("Data")]

[TypeConverter(typeof(MyConverter))]

public string MyProp

{

get { return _myProp; }

set { _myProp = value; }

}

}

public class MyConverter : StringConverter

{

public override bool GetStandardValuesSupported(ITypeDescriptorContext
context)

{

//true means show a combobox

return true;

}

public override bool GetStandardValuesExclusive(ITypeDescriptorContext
context)

{

//true will limit to list. false will show the list, but allow free-form
entry

return true;

}

public override System.ComponentModel.TypeConverter.StandardValues Collection
GetStandardValues(ITypeDescriptorContext context)

{

return new StandardValuesCollection( new string[] { "entry1", "entry2",
"entry3" });

}

}
Aug 29 '06 #1
0 1902

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

Similar topics

0
by: SlipperyCat | last post by:
I want to use the property grid to display instances of dynamic types. A problem I'm having is that the property grid is not respecting attributes that are set with SetCustomAttribute. I've taken...
0
by: TRUMPh | last post by:
Context: I have a list with indeterminately entrys @design time. The user should choose one of the item via property grid. I create a classes and a instances of enums @RunTime. For each...
2
by: Shanthi | last post by:
I am using property grid in C# application. Property grid displays the propeties properly. But I have some problem in displaying custom validation message. I have integer type property. When I...
1
by: otto | last post by:
Hi , I have a requirement in my application where in a list of properties are show in the property grid control. The senario right now is , i use the property control provided in .net to show...
8
by: stephen | last post by:
Hi, I make use of properties to store values that are relevant to the page but this time I am posting the page to itself and the values are Zero or null (they disappear). is there any other way...
1
by: John Kraft | last post by:
Hi all, I'm trying to use a property grid, and what I'm trying to do seems to really elude me. I've been using the property grid for a short period of time, and this is the first thing I...
5
by: Kimmo Laine | last post by:
Hi is there a way to change propertys attribute from the code? Letīs say that i have the following property in my class: public int Count } Is there a way to change the displayname, from...
6
by: Ron M. Newman | last post by:
Hi, I have a problem with dynamically putting dynamic properties on the property grid. My app has no idea what it'll be showing at compile time. How do I dynamically add properties to the...
2
by: Ray Cassick | last post by:
I am looking for a way to hide a property I created on a user control from a property grid at runtime but allow it to be seen at design time. Any ideas? I tried setting the category of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...
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...

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.