XPMemberInfo.GetModified(Object) Method
Checks whether or not the member is modified.
Namespace: DevExpress.Xpo.Metadata
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
NuGet Package: DevExpress.Xpo
Declaration
Parameters
Name | Type | Description |
---|---|---|
theObject | Object | A persistent object that will be checked. |
Returns
Type | Description |
---|---|
Boolean |
|
Remarks
Set the Session.TrackpropertiesModifications or XpoDefault.TrackPropertiesModifications property to true
to track changes. The GetModified
method always returns false if a Session does not track changes made to properties.
XPMemberInfo member = customer.ClassInfo.GetMember(propertyName);
string memberValue;
if(member.GetModified(customer)) {
memberValue = string.Format("{0} (old value: {1})", member.GetValue(customer), member.GetOldValue(customer));
}
else {
memberValue = (string)member.GetValue(customer);
}
For more information, refer to the %PUBLIC%\Documents\DevExpress Demos 24.1\Components\WinForms\CS\XpoTutorials\ModifiedProperties\ModifiedProperties.cs file.