CardView Blazor API

CardView Properties

NameTypeDefaultDescription
AddNewButtonboolfalseToggles the button for adding new cards.
AllowDragboolfalseAllows reordering by dragging cards.
CardHeightint?N/ADescribes the height for each card.
CellOrientationOrientationOrientation.VerticalDescribes the orientation of the card cells.
CollapsibleboolfalseAllows collapsing the card content.
ColumnsIEnumerable<ICardViewColumn>N/ADescribes the columns properties:
  • label - Sets the column name
  • dataField - Sets the dataField name
  • icon - Sets the icon for the column
  • formatSettings - Sets the settings about the format for the current column
  • formatFunction - Function for customizing the value
CoverFieldstring""""Describes which data field to be set as cover.
CoverModeCardViewCoverModeCardViewCoverMode.CropDescribes the cover image fit property.
DataSourceobjectN/ADetermines the data source for the item that will be displayed inside the card.
DataSourceSettingsDataSourceSettingsN/ASets the grid's data source settings when the dataSource property is set to an Array or URL.
EditableboolfalseAllows the edit option for the cards.
HeaderPositionCardViewHeaderPositionCardViewHeaderPosition.NoneSets or gets the header position. The header contains the Customize, Filter, Sort, and Search buttons.
Localestring"en"Sets or gets the locale. Used in conjunction with the property messages.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
Themestring""Determines the theme. Theme defines the look of the element
ScrollingScrollingScrolling.PhysicalDescribes the scrolling behavior of the element.
TitleFieldstring""Describes which data field to be set as title.

CardView Methods

NameTypeArgumentsDescription
AddFiltervoidstring[] filters, string operatorArgAdds filteringArgs: string[] filters - Filter information,string operator - Logical operator between the filters of different fields
AddFiltervoidstring[] filtersAdds filtering
AddRecordvoidobject recordId, object data, string positionAdds a new recordArgs: object recordId - The id of the record to add,object data - The data of the record to add,string position - The position to add the record to. Possible values: 'first' and 'last'.
AddRecordvoidN/AAdds a new record
AddSortvoidIEnumerable<object> dataFields, IEnumerable<object> orderByAdds sortingArgs: string dataFields - The data field(s) to sort by,IEnumerable<object> orderBy - The sort direction(s) to sort the data field(s) by
AddSortvoidstring dataFields, string orderByAdds sortingArgs: string dataFields - The data field(s) to sort by,string orderBy - The sort direction(s) to sort the data field(s) by
BeginEditvoidobject recordIdBegins an edit operationArgs: object recordId - The id of the record to edit
BeginEditvoidint recordIdBegins an edit operationArgs: int recordId - The id of the record to edit
BeginEditvoidstring recordIdBegins an edit operationArgs: string recordId - The id of the record to edit
CancelEditvoidN/AEnds the current edit operation and discards changes
ClosePanelvoidN/ACloses any open header panel (drop down)
EndEditvoidN/AEnds the current edit operation and saves changes
EnsureVisibleobjectobject recordIdMakes sure a record is visible by scrolling to it. If succcessful, the method returns the HTML element of the record's card.Args: object recordId - The id of the record to scroll to
EnsureVisibleobjectint recordIdMakes sure a record is visible by scrolling to it. If succcessful, the method returns the HTML element of the record's card.Args: int recordId - The id of the record to scroll to
EnsureVisibleobjectstring recordIdMakes sure a record is visible by scrolling to it. If succcessful, the method returns the HTML element of the record's card.Args: string recordId - The id of the record to scroll to
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
OpenCustomizePanelvoidN/AOpens the "Customize cards" header panel (drop down)
OpenFilterPanelvoidN/AOpens the "Filter" header panel (drop down)
OpenSortPanelvoidN/AOpens the "Sort" header panel (drop down)
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RemoveFiltervoidN/ARemoves filtering
RemoveRecordvoidobject recordIdRemoves a recordArgs: object recordId - The id of the record to remove
RemoveRecordvoidint recordIdRemoves a recordArgs: int recordId - The id of the record to remove
RemoveRecordvoidstring recordIdRemoves a recordArgs: string recordId - The id of the record to remove
RemoveSortvoidN/ARemoves sorting
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
ShowColumnvoidstring dataFieldShows a columnArgs: string dataField - The data field of the column
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

CardView Events

NameTypeDescriptionEvent Detail
OnFilterEventCallback<Event>This event is triggered when a filter has been applied.N/A
Filteredevent CardViewFilteredEventHandlerThis event is triggered when a filter has been applied.CardViewFilteredEventArgs
OnSortEventCallback<Event>This event is triggered when sorting has been applied.N/A
Sortedevent CardViewSortedEventHandlerThis event is triggered when sorting has been applied.CardViewSortedEventArgs
OnOpenEventCallback<Event>This event is triggered when the window is opened.N/A
Openedevent CardViewOpenedEventHandlerThis event is triggered when the window is opened.CardViewOpenedEventArgs
OnOpeningEventCallback<Event>This event is triggered when the window is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function.N/A
Openingevent CardViewOpeningEventHandlerThis event is triggered when the window is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function.CardViewOpeningEventArgs
OnCloseEventCallback<Event>This event is triggered when the window is closed.N/A
Closedevent CardViewClosedEventHandlerThis event is triggered when the window is closed.CardViewClosedEventArgs
OnClosingEventCallback<Event>This event is triggered when the window is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.N/A
Closingevent CardViewClosingEventHandlerThis event is triggered when the window is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.CardViewClosingEventArgs
OnDragStartEventCallback<Event>This event is triggered when the user starts dragging the card.N/A
DragStartedevent CardViewDragStartedEventHandlerThis event is triggered when the user starts dragging the card.CardViewDragStartedEventArgs
OnDraggingEventCallback<Event>This event is triggered when the user is dragging the card.N/A
Draggingevent CardViewDraggingEventHandlerThis event is triggered when the user is dragging the card.CardViewDraggingEventArgs
OnDragEndEventCallback<Event>This event is triggered when the user dragged the card.N/A
DragEndedevent CardViewDragEndedEventHandlerThis event is triggered when the user dragged the card.CardViewDragEndedEventArgs

Enums

Orientation

Orientation.Horizontal
Orientation.Vertical

CardViewColumnDataType

CardViewColumnDataType.String
CardViewColumnDataType.Date
CardViewColumnDataType.Boolean
CardViewColumnDataType.Number
CardViewColumnDataType.Array
CardViewColumnDataType.Any

CardViewCoverMode

CardViewCoverMode.Fit
CardViewCoverMode.Crop

DataSourceSettingsSanitizeHTML

DataSourceSettingsSanitizeHTML.All
DataSourceSettingsSanitizeHTML.BlackList
DataSourceSettingsSanitizeHTML.None

DataSourceSettingsDataFieldDataType

DataSourceSettingsDataFieldDataType.String
DataSourceSettingsDataFieldDataType.Date
DataSourceSettingsDataFieldDataType.Boolean
DataSourceSettingsDataFieldDataType.Number
DataSourceSettingsDataFieldDataType.Array
DataSourceSettingsDataFieldDataType.Any

DataSourceSettingsDataSourceType

DataSourceSettingsDataSourceType.Array
DataSourceSettingsDataSourceType.Json
DataSourceSettingsDataSourceType.Xml
DataSourceSettingsDataSourceType.Csv
DataSourceSettingsDataSourceType.Tsv

CardViewHeaderPosition

CardViewHeaderPosition.None
CardViewHeaderPosition.Top
CardViewHeaderPosition.Bottom

Scrolling

Scrolling.Physical
Scrolling.Virtual
Scrolling.Infinite
Scrolling.Deferred

CardViewColumn Properties

NameTypeDefaultDescription
DataFieldstring""Sets or gets the column's data source bound field.
DataTypeCardViewColumnDataTypeCardViewColumnDataType.StringSets or gets the column's data type.
Iconobject""Sets or gets the column's icon. Expects CSS class name.
ImageboolfalseSets or gets the column's image visibility.
Labelstring""Sets or gets the text displayed in the column's header.
VisiblebooltrueSets or gets whether the column is visible. Set the property to 'false' to hide the column.
FormatFunctionAction<object>nullSets or gets the column's format function.
FormatSettingsobjectnew object()Sets or gets the column's format settings. You can use any of the build in formatting options or to NumberFormat object like that: 'Intl: { NumberFormat: { style: \'currency\', currency: \'EUR\' }}' or DateTimeFormat object like that: 'Intl: { DateTimeFormat: { dateStyle: \'full\' }}''

DataSourceSettings Properties

NameTypeDefaultDescription
AutoGenerateColumnsboolfalseSets or gets whether a column will be auto-generated.
ChildrenDataFieldstring""Sets or gets a children data field like 'children', 'items' in the data source. When this property is set, the component will look for this data field when looping through the items. If it is found a hierarchical data source would be created.
Rootstring""Sets or gets the XML binding root.
SanitizeHTMLDataSourceSettingsSanitizeHTMLDataSourceSettingsSanitizeHTML.BlackListSets or gets the XML binding root.
Recordstring""Sets or gets the XML binding record.
GroupBystring[]new string[]{}Sets or gets the data fields to group by.
DataFieldsIEnumerable<IDataSourceSettingsDataField>nullSets or gets the data fields which decribe the loaded data and data type. Ex: ['id: number', 'firstName: string', 'lastName: string']
DataSourceTypeDataSourceSettingsDataSourceTypeDataSourceSettingsDataSourceType.ArraySets or gets whether the data source type.
Idstring""Sets or gets the component's id
KeyDataFieldstring""Sets or gets the key data field to be used for building the hierarchy. It is used in combination with the parentDataField property. Usually the 'id' field is used as key data field and 'parentId' as parent data field'
ParentDataFieldstring""Sets or gets the parent data field to be used for building the hierarchy. It is used in combination with the keyDataField property. Usually the 'id' field is used as key data field and 'parentId' as parent data field'
MapCharstring"."Sets the 'mapChar' data field of the record
VirtualDataSourceobjectnullSets the virtual data source function which is called each time the Grid requests data. Demos using 'virtualDataSource' are available on the Grid demos page.
VirtualDataSourceOnExpandobjectnullSets the virtual data source on expand function. This function is called when we load data on demand in Tree or TreeGrid and virtualDataSource in these components is set, too

DataSourceSettingsDataField Properties

NameTypeDefaultDescription
Namestring""Sets the dataField name.
Mapstring""Sets the dataField mapping path. For nested mapping, use '.'. Example: 'name.firstName'.
DataTypeDataSourceSettingsDataFieldDataTypeDataSourceSettingsDataFieldDataType.StringSets the dataField type.