A wide transaction table can work well on a desktop and become frustrating on a phone. Horizontal scrolling keeps every column available, but readers must move back and forth to understand one record.
For our bank transaction review screen in Billy, we wanted a detailed table on wider screens and a compact, read-only card on narrow screens. The key idea is to keep one dx-data-grid and change its data-row template when available space changes. That keeps one grid instance and one data source responsible for search, filtering, sorting, paging, and remote requests.
Wide layout: a detailed table when there is room for columns. AI-generated illustration.
Use a data row template on narrow screens
DevExtreme DataGrid provides dataRowTemplate for custom data rows. In Angular, the template receives a row object, with the record in item.data. Bind a named template to a responsive state. This simplified example shows the idea; adapt field names and syntax to your Angular and DevExtreme versions:
<section [class.transaction-grid--compact]="compact()"> <dx-data-grid [dataSource]="transactionStore" keyExpr="id" [dataRowTemplate]="compact() ? 'transactionCard' : undefined" [showColumnHeaders]="!compact()" [allowColumnReordering]="!compact()" [columnFixing]="{ enabled: false }"> <dxo-search-panel [visible]="true" /> <dxo-selection [mode]="compact() ? 'none' : 'multiple'" /> <dxi-column dataField="transactionDate" dataType="date" /> <dxi-column dataField="counterparty" /> <dxi-column dataField="amount" dataType="number" /> <dxi-column dataField="status" /> <ng-container *dxTemplate="let item of 'transactionCard'"> <tr> <td [attr.colspan]="item.columns.length"> <article class="transaction-card"> <div class="transaction-card__heading"> <time>{{ item.data.transactionDate | date:'mediumDate' }}</time> <strong>{{ item.data.amount | currency:item.data.currency }}</strong> </div> <strong>{{ item.data.counterparty }}</strong> <span>{{ item.data.status }}</span> </article> </td> </tr> </ng-container> </dx-data-grid> </section> The same grid remains mounted while its row presentation changes.
Measure the grid, not only the viewport
A viewport media query can work for a full-page grid. It can give the wrong answer when the grid sits beside a sidebar, inside a split view, or in a dialog. In those cases, observe the grid host with ResizeObserver and expose a boolean or signal such as compact. Choose the threshold from the minimum width at which your desktop columns remain useful; 560 pixels is only an example. Test phones in both portrait and landscape.
Compact layout: the same records as cards on a narrow screen. AI-generated illustration.
Keep query state in one place
Two separate components displaying the same records need synchronization for search text, filters, and sorting. A single grid avoids that second state model: its existing data source and query state remain in place when only the row template changes.
- Search highlighting: built-in cell highlighting does not automatically mark arbitrary text inside your own card template. Render matches in the template if you want that behavior.
- Filters: decide whether compact users can change or clear filters. Hiding filter controls does not remove a filter already applied.
- Actions: choose which actions fit the mobile workflow. Our compact cards are read-only; bulk actions stay in the desktop table.
Handle empty and loading states
Show useful feedback both when the source has no records and when search or filters return no matches. In Billy, the shared dxGridCardEmpty directive handles no-data and no-results states for the grid and card-style presentation. Each can be configured as text, text with an icon, or a caller-provided template. Use the grid’s load panel or an app-level loading state for loading, and provide a clear error state when a request fails.
Scope styles to compact mode
A custom row template changes the rendered DOM. Do not assume the default cell spacing and borders will look like cards. Put a compact-mode class on a containing element and scope styles to it. Place rules where they can reach DevExtreme’s generated markup, then inspect the rendered DOM and active theme.
.transaction-grid--compact .dx-datagrid-rowsview { background: transparent; border-top: 0; } .transaction-grid--compact .dx-datagrid-rowsview .dx-row > td { padding: 14px; } .transaction-grid--compact .transaction-card { display: grid; gap: 0.5rem; padding: 0.75rem; border-radius: 0.75rem; background: #fff; } These selectors are illustrative. Theme and version details can change the markup and cascade, so avoid broad global overrides.
Know the trade-offs
DevExtreme’s dataRowTemplate documentation says to disable column reordering, grouping, and column fixing while using a row template; command columns are not supported. Editing, selection, master-detail, adaptability, and focused-row behavior must be implemented manually. Custom template content is omitted from built-in Excel export unless you recreate it with the Excel export API. A read-only mobile card mode can be a good fit when the desktop table retains the full editing workflow.
Keep remote data loading on the same source
Changing row presentation does not replace the data source. An OData source can remain attached to the same grid while it performs configured paging, filtering, and sorting. Set remoteOperations for your data source and verify the actual requests; remote processing has restrictions, including for calculated columns. Virtual and infinite scrolling are separate from the row-template choice. DevExtreme requires a grid height for these scrolling modes. Its scrolling documentation explains that virtual scrolling loads pages as they enter the viewport, while infinite scrolling requests the next page at the end of the scroll range.
Test transitions, not just screenshots
Change the available width while search text, filters, and sorting are active. Also verify loading, no data, no results, long values, mobile landscape, keyboard access, and OData requests. If compact mode is read-only, confirm that actions hidden on mobile remain available in the desktop layout.
The result is a responsive presentation backed by one grid and one data flow: a detailed table for desktop work and a focused card for narrow screens.



