|
-
Dec 18th, 2002, 02:25 PM
#1
Switch between Write/Read Only on a PropertyGrid
Is there a way to switch the PropertyGrid between ReadOnly and Write without having two classes with different TypeConverters?
I want to use a PropertyGrid to show the values of the properties of a complex object but depending on who is looking at them they may need to be read only. The only way I see now to make it Read Only is to give the class its binding to a TypeConvert that can't convert. Is there another way?
Also I am using a PropertyGrid instead of a DataGrid because it is one object with many properties. In a datagrid that would mean 1 row and many columns which I don't want. Unless there is a way to switch the column and rows so the rows were the header and the columns the values. If you know how to do that then that'd be great as well?
Thanks for any help or advice.
-
Jan 29th, 2004, 02:22 PM
#2
Frenzied Member
use one type converter and provide it with the user info through the context and an internal(thats C# might be friend in vb not sure) method or just put some api in the converter to get the user info......
Do you know how I would get an int to act like an enum of bitmaps like the Image property of a control using an ImageList?
Magiaus
If I helped give me some points.
-
Jan 29th, 2004, 02:42 PM
#3
I don't understand the question. The imagelist is a collection and the index is the index from the imagecollection. What are you trying to do? Or give me a mock syntax for what you are trying to accomplish.
-
Jan 29th, 2004, 08:13 PM
#4
Frenzied Member
sorry, i have a really bad internet connection and i get kicked allot so i was trying to say it well as fast as i could...
I have made an ASP.Net Server control in C# (but that doesn't really matter). And, I am using it to cache images on a page so my controls can have built in rollover and the like without loading an image more then once. I want the Image property of the controls to act the same as the Image property for say a TreeView and have a dropdown with the enumed images and thier index number. but I'm unsure of what to pass out as the StanderedValues. I haven't tried anything yet but I assume it's simple then I want to think and i pass an array of bitmaps... but i wanted a second opinion and no one really knows anything about type converters and designers as far as I can tell.
Magiaus
If I helped give me some points.
-
Jan 29th, 2004, 09:11 PM
#5
It may be different in ASP.NEt but in a WinForm control you can add an Editor attribute to the property that makes it so you can choose an image from the ImageList. On my site I have an Extender Provider control that works kind of like a ToolTip control to provide images to a standard .NET MainMenu. In it I use the Editor attribute so that I have that functionality at designtime of picking the image. Maybe that will help there are also links in the code to sources of info on the subject:
http://www.edneeis.com/control.aspx?ID=9
-
Feb 1st, 2004, 04:47 PM
#6
Frenzied Member
Magiaus
If I helped give me some points.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|