Kentico CMS 6.0 Controls

Configuration

Configuration

Previous topic Next topic Mail us feedback on this topic!  

Configuration

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

As it is inherited from the BasicUniView control, which is in turn derived from the UniView control, the QueryUniView control has all of their properties. These can be found in the BasicUniView -> Configuration and UniView -> Configuration topics.

 

In addition, it has all of the following properties that can be set or used in the API:

 

CMSBase - common properties

CMS Custom query - common properties

 

As well as:

 

Property Name

Description

Sample Value

DelayedLoading

Indicates whether data should be loaded during the load event instead of the default init event.

 

EnablePaging

Indicates whether the built-in UniPager control should be used to for paging. If you wish to use paging, please be sure to set LoadHierarchicalData to false, as hierarchical data cannot be paged.

 

IDColumnName

Gets or sets the name of the column that is used as a unique identifier for the displayed objects. It is used in a parent-child relationship with the column specified in the ParentIDColumnName property.

"NodeID"

IsSelected

Indicates whether the current data source contains the selected item.

 

ItemSeparatorValue

Separator between displayed items. This property has greater priority than the separator set in the transformation given in the SeparatorTransformationName property.

"<hr/>"

LevelColumnName

Gets or sets the name of the column that is used to determine the hierarchical level of items.

"NodeLevel"

LoadHierarchicalData

Indicates whether data should be bound in default format or changed to a hierarchical grouped dataset.

 

PagerControl

Gets the current UniPager control used for paging.

 

PagerPosition

The position of the pager relative to the paged data.

"Bottom"

"Top"

"TopAndBottom"

ParentIDColumnName

Gets or sets the name of the column that contains the unique identifier of an object's parent. It is used in a parent-child relationship with the column specified in the IDColumnName property.

"NodeParentID"

SelectedDatabaseColumnName

Gets or sets the column name that should be used to identify the currently selected item.

"DocumentID"

SelectedQueryStringKeyName

Gets or sets the query string key name. The presence of this key in a query string indicates that some item should be selected. The item is determined by the value of the query string key.

 

SelectedValidationType

Gets or sets the validation type used for the query string key that determines which item is selected.

"int"

"guid"

"string"

ShowEditDeleteButtons

Indicates if edit and delete buttons should automatically be shown for each displayed item in the edit mode of CMS Desk.

 

UseHierarchicalOrder

Indicates whether the default hierarchical order value should be used. The order is used only if LoadHierarchicalData is set to true. The default order value is "NodeLevel, NodeOrder". The value of the OrderBy property is added to the end of the OrderBy expression.

 

Enabling this property is only recommended when displaying documents.


 

Specifying transformations

 

The following properties can be filled to define which transformations should be used by the control. All transformations are specified in format:

 
<document type code name>.<transformation name>

 

The design of the listed items can alternatively be set by defining the ItemTemplate elements inherited from the UniView control between the tags of the QueryUniView control.

 

Property Name

Description

Sample Value

AlternatingTransformationName

Name of the transformation applied to items that have an even position in the listing order. Every level in the hierarchy has its own separate alternation pattern.

 

FirstTransformationName

Name of the transformation applied to the first item on every level in the hierarchy. Only works for levels that contain more than one item.

 

FooterTransformationName

Name of the transformation rendered at the end of every level (after the last item on the level). Can be used to close encapsulating elements from the Header.

 

HeaderTransformationName

Name of the transformation rendered at the beginning of every level (before the first item on the level). Provides a convenient way to visually separate or style individual levels.

 

HierarchicalTransformationName

Name of the used hierarchical transformation.

 

Please see the Using hierarchical transformations topic for an example of how this property can be used.

 

LastTransformationName

Name of the transformation applied to the last item on every level in the hierarchy. Only works for levels that contain more than one item.

 

SeparatorTransformationName

Name of the transformation rendered between items.

 

If hierarchical data is loaded, the separator is placed only between items on the same level (i.e. not between a parent item and its child).

 

SingleTransformationName

Name of the transformation applied in cases where there is only one item on a level in the hierarchy.

 

TransformationName

Name of the transformation applied to all displayed items that are not covered by a specialized transformation type (e.g. alternating items, first items etc.).

 

 

Configuring the pager

 

The QueryUniView control has a built-in UniPager control which can be enabled by the EnablePaging property. The following templates can be defined within the tags of the QueryUniView control to determine the design of the pager. Please refer to the UniPager -> Structure topic to see what individual templates represent.

 

Template Name

Description

Sample Value

PagerCurrentPageTemplate

Code of the template used for the current page in the pager. Use <%# Eval("Page") %> to get the current page number, <%# Eval("PageURL") %> to get page the URL or <%# Eval("PageLink") %> to get the page link.

<strong><%# Eval("Page") %></strong>

PagerDirectPageTemplate

Code of the template used for direct page changing. Use a TextBox or DropDownList control with ID directPageControl to register the page change event.

Page

<asp:TextBox ID="DirectPageControl" runat="server" Style="width: 25px;" />

of

<%# Eval("Pages") %>

PagerFirstPageTemplate

Code of the template used for the link to the first page in the pager. Use <%# Eval("FirstURL") %> to get the link to the first page.

<a href="<%# Eval("FirstURL") %>">|&lt;</a>

PagerLastPageTemplate

Code of the template used for the link to the last page in the pager. Use <%# Eval("LastURL") %> to get the link to the last page.

<a href="<%# Eval("LastURL") %>">&gt;|</a>

PagerLayoutTemplate

Code of the template used for the overall pager layout.

 

PagerNextGroupTemplate

Code of the template used for the link to the next group of pages. Use <%# Eval("NextGroupURL") %> to get the link to the next group.

<a href="<%# Eval("NextGroupURL") %>">...</a>

PagerNextPageTemplate

Code of the template used for the link to the next page. Use <%# Eval("NextURL") %> to get the link to the next page.

<a href="<%# Eval("NextURL") %>">&gt;</a>

PagerPageNumbersSeparatorTemplate

Code of the template used for the separator between page links in the pager.

&nbsp;

PagerPageNumbersTemplate

Code of the template used for page links in the pager. Use <%# Eval("Page") %> to get the current page number, <%# Eval("PageURL") %> to get the URL of the current page or <%# Eval("PageLink") %> to get the page link.

<a href="<%# Eval("PageURL") %>"><%# Eval("Page") %></a>

PagerPreviousGroupTemplate

Code of the template used for the link to the previous group of pages. Use <%# Eval("PreviousGroupURL") %> to get the link to the next group.

<a href="<%# Eval("PreviousGroupURL") %>">...</a>

PagerPreviousPageTemplate

Code of the template used for the link to the previous page. Use <%# Eval("PreviousURL") %> to get the link to the next page.

<a href="<%# Eval("PreviousURL") %>">&lt;</a>