Skip to content

net90_PropertyGridHelpers.Attributes_AllowBlankAttribute_AllowBlankAttribute

dparvin edited this page May 25, 2025 · 10 revisions

AllowBlankAttribute constructor

Specifies whether a blank (empty) value is allowed for a property, typically used in dropdown editors.

public AllowBlankAttribute(bool allow = true, bool includeItem = false, string resourceItem = "")
parameter description
allow if set to true allow blank values in the property.
includeItem if set to true include item in the dropdown to indicate blank.
resourceItem The resource item to use for displaying the blank item (Leaves it empty when this is not provided).

Remarks

This attribute is used in conjunction with editors like ResourcePathEditor and converters like OnlySelectableTypeConverter to optionally include a blank entry in the list of selectable values.

Examples

[AllowBlank(includeItem: true, resourceItem: "Blank_DisplayText")]
[Editor(typeof(ResourcePathEditor), typeof(UITypeEditor))]
[TypeConverter(typeof(OnlySelectableTypeConverter))]
public string ResourcePath { get; set; }

See Also

Clone this wiki locally