If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: PropertyGrid appearence

Without having ever used a property grid in one of my apps or any deeper reseach, here's a shot in the dark: Couldn't you simply represent your groups as property tabs?

Originally Posted by kumsudheer

Hi Eri523, can u give me any suggesion?

Thianks for your trust in my abilities , but what again about that bumping? You don't even gain anything substantial by doing that: In a forum section with traffic as low as the one here, your post will still be on top of the list after such a short time anyway.

Last edited by Eri523; March 5th, 2012 at 06:46 AM.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Re: PropertyGrid appearence

No Eri, I need only such requirement, but anyhow I ll try to do it some other way

Originally Posted by Eri523

but what again about that bumping? You don't even gain anything substantial by doing that: In a forunm section with traffic as low as the one here, your post will still be on top of the list after such a short time anyway.

Actually i dont want do it but i was in hurry to see any replies, next time i ll avoid it.

Re: PropertyGrid appearence

Originally Posted by kumsudheer

No Eri, I need only such requirement, but anyhow I ll try to do it some other way

An alternative idea I had before I got to the property tabs and then abandoned was to use multiple property grids (one for each group), and put each on its own dialog tab. However, that may look somewhat awkward and not be an option for you either. In Addition, it would require you to create wrapper classes for each subset of properties of the actual object that you want to expose as a tab.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Re: PropertyGrid appearence

AFAICT the property grid does not show grid lines until you set its SelectedObject property. The only setting I know you can (instantly) customize about the grid lines is their color. In order to really customize the property grid, of course, you'd either derive your own control class from it and override anything needed, or handle its Paint event, just like with any other control. With a complex control like the property grid that may be quite some effort, though.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

each property can be associate to only one Category attribute right ??

In order to really customize the property grid, of course, you'd either derive your own control class from it and override anything needed, or handle its Paint event, just like with any other control. With a complex control like the property grid that may be quite some effort, though.

Ya Eri We can do in that way but it will be realy very complex ...

Leave about it ..
can you say how we set or clear this Browsable attribute at run time ..

for example, the above property i want to set at run time I had tried like below
if(platform)
{
AttributeCollection^ attributes = TypeDescriptor::GetProperties(temp) [ "BGColor" ]->Attributes;
attributes[ BrowsableAttribute::typeid ] = BrowsableAttribute::Yes;
}

but i got this error : AttributeCollection doesnt have "Set" method
so in which way i can set this [Browsable(false)] attribute to true at run time?? should we can set this attribute to "true" or "false" at only class definition time??

Re: PropertyGrid appearence

so in which way i can set this [Browsable(false)] attribute to true at run time?? should we can set this attribute to "true" or "false" at only class definition time??

any idea ??

While I still maintain the claim that the browsable attributes of the properties of the object attached to the property grid can't be changed at runtime, in the meantime I discovered the PropertyGrid::BrowsableAttributes property that may well help you to do a step in the desired direction. As I understand it, it allows to filter at runtime which properties actually are displayed in the property grid, so it may be used to achieve an effect equivalent to changing the browsable attributes at runtime. You'll probably need to define your own attribute to assign your properties to your custom categories at design time, in order to later filter them by that attribute at runtime. However, of course, that still won't add a new visual level of property categorization to the property grid.

And no, I don't really think deriving your own control class from PropertyGrid is an option for you. I rather mentioned that in response to post #6, made by another forum member.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Re: PropertyGrid appearence

Originally Posted by kumsudheer

Guys use this code for your reference to display/hide the properties at run time

Thanks for posting the code. This probably may really be helpful for others who want to do something similar. It would, however, be much more valuable as a reference when posted with code tags. I suggest you edit your posts to add the tags [EDIT:] and ensure proper indentation.

You then can also mark the thread [RESOLVED] using the Thread Tools menu at the top of the thread display, indicating to other users that they may find a solution inside.

Last edited by Eri523; April 16th, 2012 at 09:28 AM.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.