Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2387
Changing the editor in one cell of a tree
posted

As I have stated before, I am working on making an property grid that is editable.  I am using the PROPERTYGRID CS as the foundation for my control.  I am struggleing because the "Embeddable Editors Overview" documentation seems to leave a lot of holes.  My current issue is how to replace/change the editor in once particular cell to the CheckEditor.

Attached is a modified version of the PROPERTYGRID CS project.  I changed out the object being displayed in favor of a simple data class with a lot of strings and one boolean.  I added a conditional check to see if the value of the property was a boolean, if true the cell's editor is set to a new CheckEditor:

if (propertyValue is System.Boolean)
    node.Cells[colValue].Editor = new CheckEditor();

The CheckEditor does not seem to be editable event though all the other string values are editable.  What needs to happen to make this editor interact correctly?

This is only a step in understanding how I can implement a custom editor for a property, along the lines of Microsoft's UITypeEditor.  We discussed this a bit in this thread, but I think it was a bit too early in my knowledge of the TreeControl. I don't understand how to connect the UltraTextEditor/EditorWithText to display my custom dialog.  I am assuming/hoping that this will continue to be done via Attribute-oriented programming.

Sam

PROPERTYGRID_CS_CustomDataObj.zip
Parents
  • 69832
    Suggested Answer
    Offline posted

    scarleton said:
    The CheckEditor does not seem to be editable event though all the other string values are editable.  What needs to happen to make this editor interact correctly?

    I took a quick look at the code and this is a bug; when the determination is made as to whether a cell can enter edit mode, the column's editor is evaluated for whether it supports the data type, but not the cell's editor. This will be fixed in a future release, but you should report it if you want to receive a notification when the fix becomes available.

Reply Children