Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxGridCardView.ViewData Property

Identifies an object adapting values provided by a data controller for grid View data representation.

#Declaration

Delphi
property ViewData: TcxGridCardViewViewData read;

#Property Value

Type
TcxGridCardViewViewData

#Remarks

Use the ViewData property to access an object adapting values provided by a data controller for displaying within a grid View. This property refers to an instance of the TcxGridCardViewViewData class. Members of this class provide access to the records currently visible within a View. They also allow moving focus through the current View’s records, selecting records, etc.

The following code shows how to use the ViewData property to select records (cards) from the cvCustomers Card View. Only the cards with cvCustomersState set to ‘CA’ are selected and these cards are then removed from the dataset.

...
var
  I: Integer;
begin
  cvCustomers.OptionsSelection.MultiSelect := True;
  with cvCustomers.ViewData do
  begin
    for I := 0 to RecordCount - 1 do
    if Records[I].Values[cvCustomersState.Index] = 'CA' then
      Records[I].Selected := True;
  end;
  cvCustomers.DataController.DeleteSelection;
end;
...
See Also