Back to Devexpress

XPView.AddProperty(String, String, Boolean, Boolean, SortDirection) Method

xpo-devexpress-dot-xpo-dot-xpview-dot-addproperty-x28-system-dot-string-system-dot-string-system-dot-boolean-system-dot-boolean-devexpress-dot-xpo-dot-sortdirection-x29.md

latest4.4 KB
Original Source

XPView.AddProperty(String, String, Boolean, Boolean, SortDirection) Method

Creates a new ViewProperty object with the specified settings and appends it to the XPView.Properties collection.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public ViewProperty AddProperty(
    string name,
    string property,
    bool group,
    bool fetch,
    SortDirection sorting
)
vb
Public Function AddProperty(
    name As String,
    property As String,
    group As Boolean,
    fetch As Boolean,
    sorting As SortDirection
) As ViewProperty

Parameters

NameTypeDescription
nameString

A String value which specifies the property name. This value is assigned to the ViewProperty.Name property.

| | property | String |

A String value which specifies the expression used to calculate the values in a column. This value is assigned to the ViewProperty.Property property.

| | group | Boolean |

true to group the view by this property; otherwise, false. This value is assigned to the ViewProperty.Group property.

| | fetch | Boolean |

true to retrieve data; otherwise, false. This value is assigned to the ViewProperty.Fetch property.

| | sorting | SortDirection |

A SortDirection enumeration value which specifies the column’s sort order. This value is assigned to the ViewProperty.Sorting property.

|

Returns

TypeDescription
ViewProperty

A ViewProperty object that was added to the collection.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddProperty(String, String, Boolean, Boolean, SortDirection) 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.

asp-net-mvc-grid-custom-binding-and-xpo/CS/XPCustomBindingExample/XPO/XpoBindingHandlers.cs#L59

csharp
SortDirection sorting = GetSortDirection(e.SortOrder);
data.AddProperty(e.FieldName, e.FieldName, true, true, sorting);
data.AddProperty("Count", "count", false);

asp-net-mvc-grid-custom-binding-and-xpo/VB/XPCustomBindingExample/XPO/XpoBindingHandlers.vb#L60

vb
Dim sorting As SortDirection = GetSortDirection(e.SortOrder)
data.AddProperty(e.FieldName, e.FieldName, True, True, sorting)
data.AddProperty("Count", "count", False)

See Also

XPView Class

XPView Members

DevExpress.Xpo Namespace