QueryRepeater

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The QueryRepeater control is inherited from the BasicRepeater control. It automatically ensures data binding. Moreover, it allows you to specify its query, ORDER BY clause and WHERE condition and it displays data without any additional code.

 

QueryRepeater can only be used with pre-defined queries stored in the document type configuration.

 

If you want to display only data from a 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 and shows the DataPager control.


PagerControl

DataPager control that ensures 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 a 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:

 

clip0028

Page url: http://devnet.kentico.com/docs/controls/index.html?queryrepeater.htm