This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
The property grid allows you to link certain editors with certain data types (for example you can associate a CheckBox with a boolean data type). For child objects I'd like to associate a custom editor that includes a button that can be clicked to display a dialog that can be used to edit properties for the selected child object. I was wondering whether it was possible to do this by inheriting all child objects from a common base type and then associating the custom editor with this base type. I would also need to be able to identify the child object iro which the custom editor button had been clicked. For example consider class Public Class MyClass Property ChildA As ChildClassA Property ChildB As ChildClassB Property BoolProp As Boolean End Class When displaying an instance of this class in the properties grid then want the custom editor to automatically be used for ChildA and ChildB where ChildClassA and ChildClassB are assumed to inherit from a common base class. When the custom editor button is clicked I need to know whether it applies to ChildA or ChildB.
|
|
|
Hello Stephen, Take a look at the following blog posts: http://www.mindscape.co.nz/blog/index.php/2008/04/30/smart-editor-declarations-in-the-wpf-property-grid/ http://www.mindscape.co.nz/blog/index.php/2008/12/11/smart-editors-for-the-wpf-property-grid-meet-smart-templates/ These describe a technique that gives you a bit more flexibility than a TypeEditor, and show how to refine that technique to pass information through the edit template into your editor button click handler. You may also find this thread: http://www.mindscape.co.nz/forums/Thread.aspx?PostID=1748 helpful in constructing the editor template. You may need more info so feel free to follow up but hopefully these will help to get you started! |
|