PGridOptionsBehavior.RefreshOnSelectedObjectChanges Property
Gets or sets whether the control automatically updates the content when the selected object’s property changes.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
Declaration
[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool RefreshOnSelectedObjectChanges { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true | true if the control updates the content when the selected object’s property changes; otherwise, false. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to RefreshOnSelectedObjectChanges |
---|---|
PropertyGridControl |
|
Remarks
If the selected object (see SelectedObject, SelectedObjects) supports the INotifyPropertyChanged interface, the control automatically updates its content when a property changes. Set the RefreshOnSelectedObjectChanges
property to false to prevent the automatic updates. To refresh the content manually, call the Refresh() or UpdateRows() method.
Example
The code below shows how the INotifyPropertyChanged interface can be implemented. Since the RefreshOnSelectedObjectChanges
property is set to false, the control does not update the content when the selected object changes.
propertyGridControl1.SelectedObject = new MyObject();
propertyGridControl1.OptionsBehavior.RefreshOnSelectedObjectChanges = false;
public class MyObject : INotifyPropertyChanged {
object myProperty;
public object MyProperty {
get {
return myProperty;
}
set {
myProperty = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("MyProperty"));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}