Back to Devexpress

IModelCommonMemberViewItem.PredefinedValues Property

expressappframework-devexpress-dot-expressapp-dot-model-dot-imodelcommonmemberviewitem-ae3d6eef.md

latest3.1 KB
Original Source

IModelCommonMemberViewItem.PredefinedValues Property

Specifies predefined values for the current Property Editor, separated by semicolons.

Namespace : DevExpress.ExpressApp.Model

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[ModelBrowsable(typeof(StringPropertyOnlyCalculator))]
string PredefinedValues { get; set; }
vb
<ModelBrowsable(GetType(StringPropertyOnlyCalculator))>
Property PredefinedValues As String

Property Value

TypeDescription
String

A string that specifies predefined values for the current Property Editor, separated by semicolons.

|

Remarks

Use this property with string type properties. Users can select one of predefined values or enter a custom value.

To include a semicolon in a predefined value, type \\;.

To include a backslash in a predefined value, type \\.

You can specify the PredefinedValues value in the Model Editor.

Alternatively, you can use ModelDefaultAttribute to specify predefined values in code.

csharp
[ModelDefault("PredefinedValues",
    "Predefined Value 1;Predefined Value 2;Predefined Value 3;Predefined Value 4")]
public virtual string StringWithPredefinedValuesProperty { get; set; }
csharp
[ModelDefault("PredefinedValues",
   "Predefined Value 1;Predefined Value 2;Predefined Value 3;Predefined Value 4")]
public string StringWithPredefinedValuesProperty {
    get => stringWithPredefinedValuesProperty;
    set => SetPropertyValue(nameof(StringWithPredefinedValuesProperty), ref stringWithPredefinedValuesProperty, value);
}

If you want to fill the predefined values list dynamically, use a custom property editor demonstrated in the following help topic: How to: Implement a Property Editor with Custom Controls that Support Predefined Values.

See Also

IModelCommonMemberViewItem Interface

IModelCommonMemberViewItem Members

DevExpress.ExpressApp.Model Namespace