krlshnx
krlshnx

Reputation: 61

Two column in one datafield - Devexpress Angular

How to combine two columns in just one dataField?

 <dxi-column
    dataField="[Year, Make, Model]"
    caption="Vehicle"
    width="auto"
    [minWidth]="100"
  ></dxi-column>

I want to combine the Year, Make, and Model field in just one column, resulting their values will just separated by a space when displayed on a table.

Upvotes: 0

Views: 2609

Answers (1)

krlshnx
krlshnx

Reputation: 61

I solved it using [cellTemplate]

<dxi-column
    cellTemplate="vehicleTemplate"
    caption="Vehicle"
    width="auto"
    [minWidth]="100"
></dxi-column>

<div *dxTemplate="let item of 'vehicleTemplate'">
    <p class="">{{ item.data.Year }} {{ item.data.Make }} {{ item.data.Model }}</p>
</div>

Upvotes: 4

Related Questions