Select theme:

Material 3

DataList (Angular)link

This guide demonstrates how to use the DataList component.

DataList Propertieslink

NameTypeDefaultDescription
Namestring'datalist' + index suffixUnique name of the DataList.
DataarraynullDataList data.
CountintegernullDataList number of all recorcds.
PageSizeinteger10DataList number of recorcds per page.
AllowPagingbooleanfalseIs paging allowed.
WrapItemsbooleanfalseIs item wrap allowed.
Visibleboolean/expressiontrueIs DataList visible.
EmptyTextstringNo records to display.DataList text on no records.
TemplatestringnullDataList template.

image

DataList Eventslink

NameTypeDefaultDescription
LoadDataeventnullLoad data event of the DataList raised on paging with info about the current page and page size

image

Customizing the DataList templatelink

By default the DataList component displays the index of the current row as template. Use the Template property to customize the appearance. The whole data item is available as data in the expression.

Template examples:

  • <strong>${data?.FirstName}</strong> - display the FirstName property in a <strong></strong> element.
  • Full Name: ${data?.FirstName} ${data?.LastName} - display two data item properties in the row.

Angular declarationlink

<rz-datalist #datalist0 [allowPaging]="true" [count]="getProductsCount" [data]="getProductsResult" [pageSize]="5" (loadData)="datalist0LoadData($event)">
  <ng-template let-data>
    {{data?.ProductName}}
    </ng-template>
</rz-datalist>

In-memory and server-side operationslink

DataList component can perform paging both in-memory and server-side.

  • For in-memory paging enable paging, add load event for the Page, call your service and set data property to returned value.
  • For server-side paging enable paging, add load event for the Page, call your service and set data and count properties to returned values, add loadData event handler, call your service again with provide information in the event argument and set again data and count properties to returned values. If you use New Data Dialog, Radzen will setup everything automatically.

Example request

http://services.radzen.com/odata/OrderDetails?$top=10&$skip=0&$count=true

image

image

© 2016-2025 Radzen Ltd. All Rights Reserved.
Designed and developed with ❤️ in Radzen Blazor Studio.

Select theme:

Material 3