-
Notifications
You must be signed in to change notification settings - Fork 1
net472_PropertyGridHelpers.Attributes_AllowBlankAttribute
dparvin edited this page Jun 29, 2025
·
13 revisions
Specifies whether a blank (empty) value is allowed for a property, typically used in dropdown editors.
[AttributeUsage(AttributeTargets.Property)]
public class AllowBlankAttribute : Attribute| name | description |
|---|---|
| AllowBlankAttribute(…) | Initializes a new instance of the AllowBlankAttribute class. |
| static Get(…) | Gets the specified context. |
| Allow { get; } | Gets a value indicating whether this AllowBlankAttribute is allowing blank values. |
| IncludeItem { get; } | Gets a value indicating whether to include item an item in the dropdown to indicate blank. |
| ResourceItem { get; } | Gets the resource item to use for displaying the blank item (Leaves it empty when this is not provided). |
| override ToString() | Converts to string. |
| static GetBlankLabel(…) | Gets the blank label. |
| static IsBlankAllowed(…) | Determines whether blank is allowed in the specified context. |
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.
[AllowBlank(includeItem: true, resourceItem: "Blank_DisplayText")]
[Editor(typeof(ResourcePathEditor), typeof(UITypeEditor))]
[TypeConverter(typeof(OnlySelectableTypeConverter))]
public string ResourcePath { get; set; }- class ResourcePathEditor
- class OnlySelectableTypeConverter
- namespace PropertyGridHelpers.Attributes
- assembly PropertyGridHelpers
- AllowBlankAttribute.cs