Skip to main content
A newer version of this page is available. .

Accessing Columns

  • 2 minutes to read

The ASPxCardView control stores its columns within the ASPxCardView.Columns collection.

An individual column can be accessed using the CardViewColumnCollection.Item property by specifying one of the following column characteristics:

Note

The following is the priority in using string column identifiers when searching for a column.

  • First, the Name property match is searched for.
  • Then, the first FieldName property match is searched for.
  • Last, the first Caption property match is searched for.

Below is an example of accessing columns using different column characteristics.


// Accessing a column by specifying its unique identifier name - a column's Name property is set to 'MyColumn1'. 
CardViewColumn colMyColumn = CardView.Columns["MyColumn1"];

// Accessing a column by specifying the name of the data source field to which it is bound - a column's FieldName property is set to 'Department'. 
CardViewColumn colDepartment = CardView.Columns["Department"];

// Accessing a column by specifying its caption - a column's Caption property is set to 'Primary Phone'. 
CardViewColumn colPhone = CardView.Columns["Primary Phone"];

// Accessing a column by its index within the Columns collection. 
CardViewColumn colFirstColumn = CardView.Columns[0];

Client columns can be accessed using the ASPxClientCardView.GetColumn, ASPxClientCardView.GetColumnByField or ASPxClientCardView.GetColumnById method.