CMSDataGrid |
The CMSDataGrid displays a table based on Kentico CMS data. It inherits the BasicDataGrid control. It automatically ensures databinding, paging and sorting.
It allows you to display Kentico CMS documents specified by path, depth, document type and WHERE condition. The CMSDataGrid control displays content without writing any additional code.
You can use the common DataGrid designer to set up CMSDataGrid style and behavior.
Please note: If you want to display data using custom query, please use the QueryDataGrid control.
Data Source
Data retrieved using the SelectDocuments query of the specified document type.
Inherits: CMSDataProperties - common properties, BasicDataGrid
Design
The design can be modified in the same way as the standard ASP.NET DataGrid control.
Example
This example will show you how to display a list of all mobile phones in the grid using the CMSDataGrid control.
- On the General tab check the "Allow sorting" box. - Now we will specify the columns that will be displayed. On the Columns tab: - Uncheck the Create columns automatically at run time box. - Add a new Bound Column from the Available columns list to the Selected columns list. Enter the following values in the appropriate fields: - Add a new Bound Column from the Available columns list to the Selected columns list. Enter the following values in the appropriate fields: - Header text: Price - Data field: ProductPrice - Sort expression: ProductPrice - On the Paging tab check the box Allow Paging. Click OK.
- ClassNames: cms.product - MaxRelativeLevel: -1 - Path: /products/%
|