Skip to main content
A newer version of this page is available. .
Tab

ASPxDataView Class

An ASPxDataView control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

public class ASPxDataView :
    ASPxDataViewBase

Remarks

The ASPxDataView control is designed to display data in a tabular layout, and supports the following common features:

  • Paginate data using the built-in pager.
  • Programmatic access to the data view control model to set properties, respond to changes in the active page, etc.
  • The ability to perform round-trips to the server using the AJAX-based callback technology.
  • Customizable appearance through themes, user-defined images, styles, and user-defined templates.

This control is shown in the image below:

DataViewItem

The ASPxDataView control supports standard data binding. That is, it can obtain data from any object which implements the IEnumerable or IDataSource interface. Data items are represented by the DataViewItem objects. These objects are stored within a collection of the DataViewItemCollection type, which can be accessed via the control’s ASPxDataView.Items property.

The ASPxDataView control provides the ability to paginate data by using the embedded pager. The number of items that can be displayed at one time is specified by the ASPxDataView.ColumnCount and ASPxDataView.RowPerPage properties. These properties specify the number of columns and rows within a view. The pagination is allowed if the ASPxDataViewBase.AllowPaging property is set to true. Otherwise, if this property is set to false, the control displays the content of all the pages.

The number of pages is returned by the ASPxDataViewBase.PageCount property. The active (selected) page is identified by its index via the ASPxDataViewBase.PageIndex property. This property can also be used to select the desired page in code.

The appearance of items displayed by the ASPxDataView control can be customized, using the template technology (the ASPxDataView.ItemTemplate property). The contents of templated items can be defined via data binding expressions.

You can customize the ASPxDataView appearance when its content is empty, by using the ASPxDataViewBase.EmptyDataText, ASPxDataViewBase.EmptyDataTemplate, and ASPxDataViewBase.EmptyDataStyle properties.

Now, the control’s layout can be defined. Set the ASPxDataView.Layout property to the Layout.Flow of the Layout.Table value, to display the control’s data in either flow mode or as a fixed table, to fill the available page area.

Note

The ASPxDataView control provides you with comprehensive client-side functionality, implemented using JavaScript code:

The client-side API is always available for this control.

See Also