GridComponent
Represents the Kendo UI for Angular Data Grid component.
Use the kendo-grid
component to display and manage tabular data.
<kendo-grid [data]="gridData"></kendo-grid>
Selector
kendo-grid
Export Name
Accessible in templates as #kendoGridInstance="kendoGrid"
Inputs
Name | Type | Default | Description |
---|---|---|---|
adaptiveMode |
|
|
Enables or disables adaptive mode. Adaptive rendering is off by default. |
autoSize |
|
|
If |
cellSelected |
|
Sets a function to determine if a data cell is selected.
The function returns an object with | |
columnMenu |
|
|
If |
data |
|
Sets the data of the Grid. If you provide an array, the Grid gets the total count automatically. (more information and example). | |
detailRowHeight |
|
Represents the height in pixels for each Grid detail row ( | |
filter |
|
Sets the filter descriptor for the data (see examples). | |
filterable |
|
|
Enables the filtering feature of the Grid for columns with a |
gridResizable |
|
|
Determines if the Grid can be resized. |
group |
|
Sets the descriptors for grouping the data (see example). | |
groupable |
|
|
If |
height |
|
Defines the height in pixels for the Grid when | |
hideHeader |
|
|
If |
isDetailExpanded |
|
Sets a function to determine if a specific row is expanded. | |
isGroupExpanded |
|
Sets a function to determine if a specific group row is expanded. | |
isRowSelectable |
|
Sets a function to determine if a data row is selectable. | |
loading |
|
|
If |
navigable |
|
By default, navigation is enabled. To disable, set to | |
pageable |
|
|
Configures the Grid pager (see example). |
pageSize |
|
Defines the page size used by the Grid pager.
Required for the | |
reorderable |
|
|
If |
resizable |
|
|
If |
rowClass |
|
Sets a function to apply custom CSS classes to each data row (see example). | |
rowHeight |
|
Represents the row height in pixels for each Grid row ( | |
rowReorderable |
|
|
Enables row reordering feature of the Grid (see example). |
rowSelected |
|
Sets a function to determine if a data row is selected (see example). | |
rowSticky |
|
Sets a function to determine if a data row is sticky (always visible after scrolling). | |
scrollable |
|
|
Defines the scroll mode for the Grid. |
selectable |
|
|
Enables the selection feature of the Grid. The |
showInactiveTools |
|
|
Specifies if the currently inactive toolbar tools will be visible. Applicable when the toolbar is configured using the |
size |
|
|
Specifies the sizing for Grid elements like tables, buttons, and inputs. |
skip |
|
Defines the number of records to skip in the pager.
Required for the | |
sort |
|
Sets the descriptors for sorting the data (see example). | |
sortable |
|
|
Enables sorting feature of the Grid for columns with a |
trackBy |
|
A function that defines how to track changes for the data rows. By default, the Grid tracks changes by the index of the data item. Edited rows are tracked by reference. See example. | |
virtualColumns |
|
|
If |
Fields
Name | Type | Default | Description |
---|---|---|---|
activeCell |
|
Returns the currently focused cell (if any). | |
activeRow |
|
Returns the currently focused row (if any). | |
columns |
|
A query list of all declared columns. | |
currentState |
|
Gets the current |
Events
Name | Type | Description |
---|---|---|
add |
|
Fires when a new row is added by clicking the Add command button (see example). |
cancel |
|
Fires when editing is canceled by clicking the Cancel command button (see example). |
cellClick |
|
Fires when a cell is clicked (see example). |
cellClose |
|
Fires when a cell edit is closed (see example). |
columnLockedChange |
|
Fires when columns are locked or unlocked. |
columnReorder |
|
Fires when columns are reordered. |
columnResize |
|
Fires when columns are resized. |
columnStickyChange |
|
Fires when columns are made sticky or unsticky. |
columnVisibilityChange |
|
Fires when column visibility changes. |
contentScroll |
|
Fires when the grid content is scrolled. The event is triggered outside the Angular zone for performance. Enter the Angular zone if you make changes that require change detection. |
dataStateChange |
|
Fires when the data state of the Grid is changed. |
detailCollapse |
|
Fires when a detail row is collapsed through the UI. |
detailExpand |
|
Fires when a detail row is expanded through the UI. |
edit |
|
Fires when a row enters edit mode (see example). |
excelExport |
|
Fires when the Excel export command is triggered. |
filterChange |
|
Fires when the Grid data is filtered through the UI and the filter descriptor changes. |
gridStateChange |
|
Fires when the data or columns state of the Grid is changed. |
groupChange |
|
Fires when the Grid data is grouped through the UI and the group descriptors change (see example). |
groupCollapse |
|
Fires when a group is collapsed through the UI. |
groupExpand |
|
Fires when a group is expanded through the UI. |
pageChange |
|
Fires when the page is changed through the UI (see example). |
pdfExport |
|
Fires when the PDF export command is triggered. |
remove |
|
Fires when a row is removed by clicking the Remove command button (see example). |
rowReorder |
|
Fires when a row is reordered through the UI. |
save |
|
Fires when a row is saved by clicking the Save command button (see example). |
scrollBottom |
|
Fires when the last record is scrolled into view (see example). |
selectionChange |
|
Fires when the Grid selection changes through the UI. |
sortChange |
|
Fires when the Grid data is sorted through the UI and the sort descriptors change (see example). |
Methods
addRow | ||||||
---|---|---|---|---|---|---|
Creates a new row editor (see example). | ||||||
|
autoFitColumn | ||||||
---|---|---|---|---|---|---|
Applies the minimum possible width for the specified column so the whole text fits without wrapping.
This method expects the Grid to be | ||||||
|
autoFitColumns | ||||||
---|---|---|---|---|---|---|
Adjusts the width of the specified columns to fit the entire content, including headers, without wrapping.
If you do not specify columns, | ||||||
|
cancelCell |
---|
Closes the current cell in edit mode. |
closeCell | ||||
---|---|---|---|---|
Closes the current cell in edit mode and fires the | ||||
|
closeRow | ||||||
---|---|---|---|---|---|---|
Closes the editor for the specified row (see example). | ||||||
|
collapseGroup | ||||||
---|---|---|---|---|---|---|
Collapses a group header at the given hierarchical index, such as This method is for backwards compatibility with legacy versions that track expanded group state by hierarchical group index. If the Grid is pageable, the group indexes are offset by the current Grid skip. | ||||||
|
collapseRow | ||||||
---|---|---|---|---|---|---|
Collapses the master row at the specified data row index (see example). This method is for backwards compatibility with legacy versions that track expanded state by row index.
For new development, use the | ||||||
|
drawPDF | ||||
---|---|---|---|---|
Exports the Grid element to a Drawing Group using the | ||||
|
editCell | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Puts the specified cell in edit mode (see example). | ||||||||||||
|
editRow | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Switches the specified table row to edit mode (see example). | ||||||||||||
|
expandGroup | ||||||
---|---|---|---|---|---|---|
Expands a group header at the given hierarchical index, such as This method is for backwards compatibility with legacy versions that track expanded group state by hierarchical group index. If the Grid is pageable, the group indexes are offset by the current Grid skip. | ||||||
|
expandRow | ||||||
---|---|---|---|---|---|---|
Expands the master row at the specified data row index (see example). This method is for backwards compatibility with legacy versions that track expanded state by row index.
For new development, use the | ||||||
|
focus | ||||
---|---|---|---|---|
Focuses the last active or the first cell of the Grid. | ||||
|
focusCell | |||||||||
---|---|---|---|---|---|---|---|---|---|
Focuses the cell with the specified row and column index. The row index is based on the logical structure of the Grid and does not correspond to the data item index. Header rows are included, starting at index 0. Group headers and footers are included. The row indexing is absolute and does not change with paging. If the Grid is configured for scrolling, including virtual scrolling, the scroll position will be updated. If the row is not present on the current page, the method will have no effect. | |||||||||
| |||||||||
|
focusNextCell | ||||||
---|---|---|---|---|---|---|
Focuses the next cell, optionally wrapping to the next row. | ||||||
| ||||||
|
focusPrevCell | ||||||
---|---|---|---|---|---|---|
Focuses the previous cell. Optionally wraps to the previous row. | ||||||
| ||||||
|
isEditing | ||||
---|---|---|---|---|
Returns | ||||
|
isEditingCell | ||||
---|---|---|---|---|
Returns | ||||
|
reorderColumn | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Changes the position of the specified column.
The reordering of columns operates only on the level inferred by the source column.
For this method to work, the | ||||||||||||
|
saveAsExcel |
---|
Initiates the Excel export (see example). |
saveAsPDF |
---|
Initiates the PDF export (see example). |
scrollTo | ||||||
---|---|---|---|---|---|---|
Scrolls to the specified row and column (see example). | ||||||
|
scrollToItem | ||||||
---|---|---|---|---|---|---|
Scrolls to the specified data item and column (see example). | ||||||
|