Back to Devexpress

IMemberInfo.GetValue(Object) Method

expressappframework-devexpress-dot-expressapp-dot-dc-dot-imemberinfo-dot-getvalue-x28-system-dot-object-x29.md

latest2.8 KB
Original Source

IMemberInfo.GetValue(Object) Method

Retrieves the member’s value.

Namespace : DevExpress.ExpressApp.DC

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
object GetValue(
    object obj
)
vb
Function GetValue(
    obj As Object
) As Object

Parameters

NameTypeDescription
objObject

The object whose property value will be returned.

|

Returns

TypeDescription
Object

An object that is the member’s value.

|

Remarks

You can pass an object that is an actual member value, or an IObjectRecord object.

csharp
ITypeInfo typeInfo = objectSpace.TypesInfo.FindTypeInfo(objectSpace.GetObjectType(objectRecord));
Object val = typeInfo.FindMember(propertyName).GetValue(objectRecord);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetValue(Object) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/CS/EFCore/EnumCheckBoxEF/EnumCheckBoxEF.Blazor.Server/Editors/EnumPropertyEditor/EnumPropertyEditor.cs#L67

csharp
protected override RenderFragment CreateViewComponentCore(object dataContext) {
    var propertyValue = MemberInfo.GetValue(dataContext);
    var enumDescriptor = new EnumDescriptor(GetUnderlyingType());

See Also

IMemberInfo Interface

IMemberInfo Members

DevExpress.ExpressApp.DC Namespace