473,320 Members | 2,073 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,320 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 1326
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.