Results 1 to 6 of 6

Thread: Switch between Write/Read Only on a PropertyGrid

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    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.

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    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.

  3. #3

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  4. #4
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    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.

  5. #5

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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

  6. #6
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    I think it may.
    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
  •  



Click Here to Expand Forum to Full Width