windowsforms-devexpress-dot-xtraverticalgrid-dot-pgridoptionsview.md
Gets or sets whether to display value representations provided by custom editors (Classic view only).
Namespace : DevExpress.XtraVerticalGrid
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
[DefaultValue(false)]
[XtraSerializableProperty]
public bool AllowPaintValue { get; set; }
<DefaultValue(False)>
<XtraSerializableProperty>
Public Property AllowPaintValue As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true, to display a property value representation; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to AllowPaintValue |
|---|---|
| PropertyGridControl |
.OptionsView .AllowPaintValue
|
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; }
}
Public Class SelectedObject
Private int_angle As Double
<EditorAttribute(GetType(AngleEditor), GetType(System.Drawing.Design.UITypeEditor))>
Public Property Angle() As Double
Get
Return int_angle
End Get
Set(ByVal value As Double)
int_angle = value
End Set
End Property
End Class
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;
}
//...
}
Public Class AngleEditor
Inherits System.Drawing.Design.UITypeEditor
' Override to provide a representation of the property's value.
Public Overrides Sub PaintValue(ByVal e As System.Drawing.Design.PaintValueEventArgs)
'...
End Sub
' Returns whether painting a representation of the property's value is supported.
Public Overrides Function GetPaintValueSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) A
Return True
End Function
'...
End Class
To enable the property grid to use the provided representation, set the AllowPaintValue property to true.
propertyGridControl1.OptionsView.AllowPaintValue = true;
PropertyGridControl1.OptionsView.AllowPaintValue = True
See Also