Skip to main content

TcxGridCardView.ViewData Property

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

Declaration

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