The QueryRepeater control is inherited from the BasicRepeater control. It automatically ensures data binding. Moreover, it allows you to specify query, ORDER BY clause and the WHERE condition and it ensures displaying data without any additional code.
QueryRepeater can be only used with pre-defined queries stored in the document type configuration.
If you want to display only data from particular part of the content tree, please use CMSRepeater instead.
Data Source
Data retrieved using the predefined query specified in the QueryName property.
Inherits: BasicRepeater, CMSQueryProperties - common properties
See also: DataPager
Properties
Property Name |
Description |
Sample Value |
AlternatingTransformationName |
Transformation name in format application.class.transformation applied to alternating items. |
"cms.news.preview_alt" |
ItemSeparator |
Item separator between displayed records. |
"<hr/>" |
EnablePaging |
Enables paging a shows the DataPager control. |
|
PagerControl |
DataPager control that ensured paging. |
|
TransformationName |
Transformation name in format application.class.transformation. |
"cms.news.preview" |
Design
The design depends on the transformations you use to display content.
Example
This example will show you how to read list of news and display them using the QueryRepeater control.
• | Create a new Web form. |
• | Drag and drop the QueryRepeater control on the form. |
• | In the Properties window set the following property values: |
- QueryName: cms.news.selectlatest
- TransformationName: cms.news.preview
• | Compile and run the project. You should see a page like this: |
Page url: http://devnet.kentico.com/docs/5_0/controls/index.html?queryrepeater.htm