Skip to main content

PGridOptionsView.AllowPaintValue Property

Gets or sets whether to display value representations provided by custom editors (Classic view only).

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.2.dll

Declaration

[DefaultValue(false)]
[XtraSerializableProperty]
public bool AllowPaintValue { get; set; }

Property Value

Type Default Description
Boolean false

true, to display a property value representation; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AllowPaintValue
PropertyGridControl
.OptionsView .AllowPaintValue

Remarks

You can provide a custom editor for a property using the Editor attibute.

public class SelectedObject {
    [EditorAttribute(typeof(AngleEditor), typeof(System.Drawing.Design.UITypeEditor))]
    public double Angle { get; set; }
}

See UITypeEditor on MSDN for more information on how to implement a custom edtior.

The UITypeEditor type exposes the virtual PaintValue and GetPaintValueSupported methods that you can override to support the display of a value’s representation.

public class AngleEditor : System.Drawing.Design.UITypeEditor {
    // Override to provide a representation of the property's value.
    public override void PaintValue(System.Drawing.Design.PaintValueEventArgs e) {
        //...
    }
    // Returns whether painting a representation of the property's value is supported.
    public override bool GetPaintValueSupported(System.ComponentModel.ITypeDescriptorContext context) {
        return true;
    }

    //...
}

To enable the property grid to use the provided representation, set the AllowPaintValue property to true.

Editor supports painting a representation of an object's value

propertyGridControl1.OptionsView.AllowPaintValue = true;
See Also