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

control property categoryattribute

Hi

I am in the middle of creating a control and wondered if someone could
help me with a problem I have.

My control is based on an existing control but I have added at least
twenty properties to this control and would like to put them in a
seperate section in the property window.

The code below puts the TableCssClass property under the "Custom
Properties" category as expected.

[
Browsable(true),
Description("css class for table to use in presentation mode."),
Category("Custom Properties"),
DefaultValue("")
]
public string TableCssClass
{
get { return _tableClass; }
set { _tableClass = value; }
}
But say for example I wanted to put the TableCssClass property into a
category named "Style" under the category named "Custom Properties".

How would I do this I'm sure it is possible because in the
"Appearance" category you see "Font" which expands to get at size
properties e.t.c.

HAS ANYBODY GOT ANY IDEAS

Thanks in advance

Lee Crowe
Jul 21 '05 #1
2 1332
Hi,

It is indeed possible to do this.

What you need to do is create a custom control class within your
control project containing all the sub-properties you want, eg.
CustomProperties.

Then add one property to your "main" control of type CustomProperties
(what you name this property will be the heading of the expandable
list) under the "Style" category. This property just needs the get part
of the property, simply returning the internal "CustomProperties"
object.

Now when you add your control you will have a property under "Style"
called "CustomProperties", which will expand revealing all the
properties of the "CustomProperties" class.

Hope this makes sense!
Regards,

Peter Chadwick (MCP)
pe**@code-explorers.com

Jul 21 '05 #2
I should probably mention that this will get your properties displaying
as desired. You will need to play around with persistence properties in
order to get all the cascading properties saving properly.

If you do a search on saving objects as properties there should be
stuff out there (I have done the same myself before, just can't
remember off the top of my head the persistence settings).
Peter Chadwick (MCP)
pe**@code-explorers.com

Jul 21 '05 #3

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

Similar topics

0
by: mevar81 | last post by:
Hello to everybody.I have a property grid im my application and I want to show not every Category of properties of a control (for example a Button).Everithing work like I aspect if want to display...
2
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...
9
by: James Geurts | last post by:
Hey all... I posted this in the vs.net ide group too, but people are not answering, so I figured that it might be more appropriate here. I'm not sure if I'm adding a designer to my code properly. ...
0
by: Tom | last post by:
I am having a really annoying issue with serialization and a .NET User Control I am writing. For example, let's say I have a couple of classes in my control - first class is like: Public Class...
3
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the...
2
by: Lee Crowe | last post by:
Hi I am in the middle of creating a control and wondered if someone could help me with a problem I have. My control is based on an existing control but I have added at least twenty properties...
4
by: John Allen | last post by:
Hi there, Does anyone know if the standard "PropertyGrid" control is (foreign) language sensitive. If I display an object in the control, and my object has the native .NET "Size" struct as a...
0
by: Hans Koller | last post by:
Hello group, I design a class to bind it to a property grid for easy modification of some settings. My problem is now that I want to raise an event when a settings has been changed. Thats not a...
4
by: usunto_bryjamus | last post by:
Hi, Is it possible to parametrize Property grid category? I have class: public class Test { private string name;
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.