[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Collapse]Xamarin Controls
 [Collapse]API Reference
    AutoGenerateColumnsMode Enumeration
   [Expand]AutoGeneratingColumnEventArgs Class
    AutoGeneratingColumnEventHandler Delegate
   [Expand]CellData Class
   [Expand]CellIndex Structure
   [Expand]ColorScaleFormatCondition Class
    ColumnContentAlignment Enumeration
   [Expand]CustomizeCellDisplayTextEventArgs Class
    CustomizeCellDisplayTextEventHandler Delegate
   [Expand]CustomizeCellEventArgs Class
    CustomizeCellEventHandler Delegate
   [Expand]CustomSummaryEventArgs Class
    CustomSummaryEventHandler Delegate
    CustomSummaryProcess Enumeration
   [Expand]DataBarFormatCondition Class
   [Expand]DateColumn Class
    EditingRowAction Enumeration
   [Expand]EditValuesContainer Class
   [Expand]ExpressionConditionBase Class
    FixedStyle Enumeration
   [Expand]FormatCondition Class
   [Expand]FormatConditionBase Class
   [Expand]FormatConditionCollection Class
   [Expand]GridColumn Class
   [Expand]GridColumnCollection Class
   [Expand]GridColumnDataEventArgs Class
    GridColumnDataEventHandler Delegate
   [Expand]GridColumnSummary Class
   [Collapse]GridControl Class
     GridControl Members
     GridControl Constructor
    [Expand]GridControl Properties
    [Expand]GridControl Events
    [Expand]GridControl Methods
    GridPopupMenuType Enumeration
    GridSortMode Enumeration
   [Expand]HorizontalScrollOffsetEventArgs Class
    HorizontalScrollOffsetEventHandler Delegate
   [Expand]IconSetFormatCondition Class
   [Expand]IEditableRowData Interface
   [Expand]IGroupInfo Interface
   [Expand]ImageColumn Class
   [Expand]IndicatorFormatConditionBase Class
   [Expand]InitNewRowEventArgs Class
    InitNewRowEventHandler Delegate
   [Expand]IRowData Interface
   [Expand]NumberColumn Class
   [Expand]PickerColumn Class
   [Expand]PopupMenuEventArgs Class
    PopupMenuEventHandler Delegate
   [Expand]RowAllowEventArgs Class
    RowAllowEventHandler Delegate
   [Expand]RowEditingEventArgs Class
    RowEditingEventHandler Delegate
    RowEditMode Enumeration
   [Expand]RowEventArgs Class
    RowEventHandler Delegate
   [Expand]RowTapEventArgs Class
    RowTapEventHandler Delegate
   [Expand]SourceRowEventArgs Class
    SourceRowEventHandler Delegate
    SummaryType Enumeration
   [Expand]SwipeButtonEventArgs Class
    SwipeButtonEventHandler Delegate
   [Expand]SwipeButtonInfo Class
   [Expand]SwipeButtonShowingEventArgs Class
    SwipeButtonShowingEventHandler Delegate
   [Expand]SwitchColumn Class
   [Expand]TemplateColumn Class
   [Expand]TextColumn Class
   [Expand]ThemeFontAttributes Class
   [Expand]TopBottomRuleFormatCondition Class
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

GridControl Class

The grid control.


Expanded Syntax

Expanded Remarks

GridControl is a data bound control that provides a set of data shaping and manipulation features, including data sorting, grouping, filtering and summary calculation.

To get started with GridControl, see the Getting Started tutorial.

Expanded Example

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T208848.

This example shows how to add columns to GridControl to display and edit data of different types. The grid is bound to a collection of Employee objects. Each Employee object contains an employee's photo (image), name, position, phone, address (strings), hire and birth dates (DateTime values), a value that specifies an employee's access level, and a Boolean value indicating whether an employee is on vacation.

Grid columns are stored in the Columns collection. An individual column is specified by a GridColumn descendant, which is appropriate to the type of data contained in this column. In this example, to display information on employees and allow end-users to edit it, the following columns are created in the grid.

Grid Column


This column displays employee photos which are images added to a project as embedded resources.
A cell in this column displays three employee properties: Name, Position and HireDate. A cell appearance is defined via a template. Each cell contains three Xamarin.Forms.Label elements within a Xamarin.Forms.Grid. Each Label element is bound to a property of the Employee class.

A cell template data context is specified by the CellData object. Its CellData.Value property provides access to a value of a data field assigned to the column's GridColumn.FieldName property. In this example, a column cell displays not only this field value but also values of two more fields. So, it is required to specify the whole data row as a binding source for the template. To do this, set the BindingContext property of the Grid to CellData.Source. Note that BindingContext specified for the Grid is inherited by all its children. This means that all Label elements have the same BindingContext as the Grid, and you can specify their simple bindings to properties of that object (Employee).

Use the GridColumn.AllowSort, GridColumn.AllowGroup and GridColumn.IsReadOnly properties to prevent end-users from sorting and grouping data in the grid by this column and disable data editing.
The employee's Phone property is of the string type. The keyboard allowing text input is automatically displayed when an end-user activates this column cell to edit an employee's phone.
This column is bound to the employee's Address string property. The keyboard allowing text input is automatically displayed when an end-user activates this column cell to edit an employee's address.
Birth Date
This column displays and allows editing employee birth days. The GridColumn.DisplayFormat property specifies the format of displaying dates.
Access Level
The employee's Access property is of the AccessLevel type which is an enumeration with values Admin and User. To allow editing an employee's access level by selecting one of two enumeration values, this property is bound to the grid's picker column.
On Vacation
The employee's OnVacation property is of the Boolean type, so it is bound to the grid's switch column which allows editing a cell value by selecting between two states.

Expanded Inheritance Hierarchy


Expanded See Also

Is this topic helpful?​​​​​​​