Need PropertyGrid Help

C

crow_y2k

Hellooo out there...

i have a problem with my propertygrid ( who dont have such a problem
;-) ):

i want to programm a small app to easy edit a .ini file. i thought that
a property grid would be a nice solution for that.

so i load the file structure ( CIniFile, CIniSection, CIniOption ) and
bind the CIniFile to the PropertyGrid. So far so good. Now i want to
display the CIniSection(s) as a Category entry an not as a Property
entry... and thats what i dont get run.

i read some articles how to format the shown properties and to add
properties at run-time or add own controls to edit properties... but i
cant find a solution to add CATEGORIES at runtime.

Would anybody know a way out?
 
N

Nicholas Paldino [.NET/C# MVP]

The only way I can think of to do this would be to implement
ICustomTypeDescriptor, and when your properties are asked for, you apply the
appropriate Category attribute to the property according to the CIniSection
instances that you have.

Hope this helps.
 
C

crow_y2k

thanks for the first message!
I also found the ICustomTypeDescriptor but i cant write to the Category
Property. Looks like it's readonly. -> Shi***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top