Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use the DefaultEditors attribute Grid Custom Editor

Shulou Source: shulou.com Published: 2022-06-01 05:21:28 10月03日 Update

Today, I will talk to you about how to use the DefaultEditors attribute grid custom editor. Many people may not know much about it. In order to let everyone know more, Xiaobian summarizes the following contents for everyone. I hope you can gain something according to this article.

the problems encountered

When a custom editor for a type is added to the PropertyGrid using the DefaultEditors property, the editor is disabled unless the type has EditorAttribute (the actual type of editor seems irrelevant).

In DevExpress version 18.1, ColorEditor works fine with Color extensions; however, in v19.2, CustomColor's editor is disabled and CustomColorAttr's editor is enabled.

solutions

PropertyGridControl - The Readonly attribute does not work with a custom editor The standard DescriptorContext.IsValueEditable method was not considered before, which led to incorrect results, and is now used correctly in code.

If you try to assign an object to a standard PropertyGrid, you get the same result because the DescriptorContext.IsValueEditable method returns false. In turn, this method returns false because the type converter used for the custom class cannot convert the string value to your type. ColorEditor uses ColorConverter, which can perform such conversions.

Therefore, to enable editing of custom classes, you need to apply a type converter that supports conversion from string values to types.

After reading the above, do you know more about how to use the DefaultEditors property grid custom editor? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Tags: Editor type attribute content grid character string method standard this method result converter error support same important irrelevant code in turn team Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL Shulou Tech Info vpn MariaDB