locked
Property Grid and Nested Objects when I cannot use a Type Converter... RRS feed

  • Question

  • I will start off by saying that I am not sure where this question should be directed, so if this is not the place, please show me where it should be.

    My issue originates from the fact that I have developed a partial-class library from a schema.
    Using the XSD.exe tool, I have a series of partial classes that are being used somewhat like a library. This code is compiled into a dll and given to a different program. This is where the issues arise.

    In this second program I would like to display these classes in a property grid. But alas they have nested objects. I would like to turn these nested objects into expandable objects much like the way the size object is found on the property grid. (Yes this is the classic size object issue for the property grid)

    My problem is, every solution I can find online for these issues suggests creating a type converter for your class. I would have no problem in doing this, except that my classes are already compiled. I cannot find a way in which I could add a type converter onto these classes aside from slipping into the code prior to compilation and manually adding the converter into the code; Which seems incredibly inefficient.

    My code needs to be able to take any schema that has moved through the XSD tool. This means there can be muti-nested objects, and making a dummy cast won't work either.

    My question is if this is even possible with the property grid? I am really hoping it will because it would save me ages of UI development.
    Friday, November 9, 2012 3:37 PM

Answers

  • The correct forum would be one of the Windows Forms forums.

    The only thing I can think of is seeing if you can slip the type converter into the type via Reflection.  I don't know about the subject, though.  Look it up.  But I'm afraid you'll have to load the assembly manually as opposed to simply reference it from your References in your project.


    Jose R. MCP
    Code Samples

    • Marked as answer by Mike Feng Wednesday, November 14, 2012 12:14 PM
    Friday, November 9, 2012 5:38 PM

All replies

  • The correct forum would be one of the Windows Forms forums.

    The only thing I can think of is seeing if you can slip the type converter into the type via Reflection.  I don't know about the subject, though.  Look it up.  But I'm afraid you'll have to load the assembly manually as opposed to simply reference it from your References in your project.


    Jose R. MCP
    Code Samples

    • Marked as answer by Mike Feng Wednesday, November 14, 2012 12:14 PM
    Friday, November 9, 2012 5:38 PM
  • Thanks, I will try the windows forms forums.
    I will try looking into the type via reflection as well

    Friday, November 9, 2012 6:27 PM