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

DataGridView and GridControl (Legacy) - Comparison

  • 5 minutes to read

This document compares the DataGridView for Xamarin.Forms with the legacy GridControl, and describes the differences in features, API, and behavior of these controls.

Features

This table lists features of the new DataGridView that the legacy GridControl does not support:

Feature

Related API

Input Validation

DataGridView.ValidateCell
DataGridView.ValidationError
EditFormPage.ValidateCell
EditFormPage.ValidateForm

Templates

DataGridView.ColumnHeaderContentTemplate / GridColumn.HeaderContentTemplate
DataGridView.GroupCaptionTemplate / GridColumn.GroupCaptionTemplate
DataGridView.GroupRowTemplate
DataGridView.GroupSummaryTemplate
DataGridView.SwipeItemTemplate / SwipeItem.Template
DataGridView.TotalSummaryTemplate / GridColumn.TotalSummaryTemplate

Multi-Row Column Layout

DataGridView.AdvancedColumnLayout
AdvancedColumnLayout.ColumnDefinitions / AdvancedColumnLayout.RowDefinitions
GridColumn.Row / GridColumn.Column
GridColumn.RowSpan / GridColumn.ColumnSpan

Row Drag and Drop

DataGridView.AllowDragDropRows / DataGridView.AllowDragDropSortedRows
DataGridView.RowDragPreviewTemplate
DataGridView.RowDragPreviewShadowColor
DataGridView.DragRow
DataGridView.DragRowOver
DataGridView.DropRow
DataGridView.CompleteRowDragDrop

Row Auto Height

DataGridView.RowHeight
DataGridView.GroupRowHeight
If these properties are set to -1, the grid adjusts the height of rows to display cells’ content.

Cascade Data Update

DataGridView.AllowCascadeUpdate
DataGridView.AllowCascadeTreeCreation

Column Header Visibility

DataGridView.IsColumnHeaderVisible

Scrollbar Visibility

DataGridView.IsHorizontalScrollBarVisible
DataGridView.IsVerticalScrollBarVisible

Column’s Properties

EditFormCaption
GroupCaptionDisplayFormat
HeaderCaptionLineBreakMode
HorizontalContentAlignment
MaxWidth

Grid’s Visual Updates

DataGridView.IsUpdateLocked
DataGridView.BeginUpdate() / DataGridView.EndUpdate()

Refresh Indicator Visibility

DataGridView.IsRefreshing

IRowData.CanGetFieldValue(String)

The following table list the GridControl‘s features that the new DataGridView does not support:

Feature

Related API

New Item Row

GridControl.NewItemRowVisibility
GridControl.InitNewRow

Auto-Filter Panel

GridControl.AutoFilterPanelVisibility
GridControl.AutoFilterPanelHeight
GridColumn.AllowAutoFilter
GridColumn.AutoFilterCondition
GridColumn.AutoFilterValue
GridColumn.ColumnFilterMode
GridColumn.ImmediateUpdateAutoFilter

Filter Panel

GridControl.FilterPanelVisibility
GridControl.FilterPanelHeight

Popup Menu

GridControl.PopupMenuCustomization
GridControl.AllowDeleteRows
GridControl.AllowEditRows
GridControl.AllowGroup
GridColumn.AllowGroup
GridControl.HighlightMenuTargetElements
GridControl.IsColumnMenuEnabled
GridControl.IsGroupRowMenuEnabled
GridControl.IsRowCellMenuEnabled
GridControl.IsTotalSummaryMenuEnabled

Column Chooser

GridControl.IsColumnChooserEnabled
GridControl.ShowColumnChooser()
GridControl.HideColumnChooser()

Resizing Columns from UI

GridControl.AllowResizeColumns

Horizontal Scrolling Virtualization

GridControl.AllowHorizontalScrollingVirtualization

Conditional Formatting

GridControl.FormatConditions

Export to Excel

GridControl.ExportToExcel(Stream, ExportTarget)
GridControl.OptionsExportXls
GridControl.OptionsExportXlsx
GridControl.OptionsExportCsv

Serialization

GridControl.RestoreLayoutFromStream(Stream)
GridControl.RestoreLayoutFromXml(String)
GridControl.SaveLayoutToStream(Stream)
GridControl.SaveLayoutToXml()

Miscellaneous

GridControl.FindRowByValue(GridColumn, Object)
GridControl.IsGroupCollapsed(Int32)
GridControl.Redraw(Boolean)
GridControl.Dispose()
GridControl.LoadInVisualTree()
GridControl.FilterApplied
GridControl.HorizontalScrollOffsetChanged
CustomizeCellDisplayTextEventArgs.Source

Behavior

This section describes differences in implementation and behavior of the functionality that the DataGridView and GridControl support.

Editing Rows

Editor

DataGridView (New) Learn more…

GridControl (Legacy) Learn more…

In-place

In-place cell editor
The grid automatically commits the edited cell value when a user taps outside the cell being edited.
Use the DataGridView.EditorShowMode property to specify a gesture that invokes an in-place editor for a cell.

In-place row editor
The grid invokes the in-place row editor (RowEditMode = Inplace) when a user double taps a data cell.

Edit Form

To allow users to edit cell values via an edit form, create an EditFormPage instance and handle the grid’s event (for example, Tap or DoubleTap) to specify a gesture that invokes the edit form.

The grid invokes an edit form according to the RowEditMode property value. To replace the default row edit form with a custom form, use the EditFormContent property.

GridControl.AllowEditRows - Specifies whether users are allowed to change cell values in the grid.

Load More

The new grid automatically performs the load-more operation unless data rows fill the entire viewport or the number of visible rows does not change.

Swipe Actions

DataGridView (New) Learn more…

GridControl (Legacy) Learn more…

DataGridView.StartSwipeItems
DataGridView.EndSwipeItems
SwipeItem

GridControl.LeftSwipeButtons
GridControl.RightSwipeButtons
SwipeButtonInfo

SwipeItem.Tap

GridControl.SwipeButtonClick
GridControl.SwipeButtonCommand

-

GridControl.SwipeButtonShowing

The grid can display an icon within a swipe item and
use a custom template that defines a swipe item’s appearance.

-

DataGridView.FullSwipeMode

-

Themes

DataGridView (New) Learn more…

GridControl (Legacy) Learn more…

Light and Dark built-in themes

using Xamarin.Forms;
using DevExpress.XamarinForms.Core.Themes;

// ... 
ThemeManager.ThemeName = Theme.Dark;

Light and Dark built-in themes

using Xamarin.Forms;
using DevExpress.Mobile.DataGrid.Theme;

// ... 
ThemeManager.ThemeName = Themes.Dark;

When the ThemeManager applies a theme, it adds implicit styles for a grid and its elements to the application’s ResourceDictionary.
You can use special target types (for example, CellStyle, GroupRowStyle, ColumnHeaderStyle, etc.) to create custom styles lower in the view hierarchy so that these styles override original styles (defined at the application level). All grids for which the corresponding resource is available uses these custom styles. You can also apply a custom style to a specific grid instance. To do this, use this grid’s *Style properties (CellStyle, GroupRowStyle, ColumnHeaderStyle, etc.).
Learn more…

To customize the applied theme, use the ThemeBase class. Its properties provide access to different customizers that you can use to change appearance settings (for example, font attributes, border and background colors, etc.) of the grid’s visual elements (data cells, group rows, filter panel, etc.).
Learn more…

Column Width

 

DataGridView (New)

GridControl (Legacy)

API

GridColumn.Width - Specifies the column width as a GridLength value. Allows you to define absolute (for example, 50) or proportional (for example, 2*) width value, but does not support the Auto option.
GridColumn.MinWidth
GridColumn.MaxWidth

GridControl.ColumnsAutoWidth
GridColumn.Width - Specifies the column width in density-independent pixels.
 

GridColumn.MinWidth

Behavior

The grid adjusts column widths so that the total width of all columns equals the grid’s width. When you set the Width property for a column, the grid automatically changes the widths of other columns. To specify the minimum and maximum column width, use the MinWidth and MaxWidth properties. If the total column width exceeds the grid’s width, horizontal scrolling is enabled.

ColumnsAutoWidth = true
The grid adjusts column widths so that the total width of all columns equals the grid’s width. If you set the Width property only for one column, and there are other columns that do not have this property defined, the grid uses your width value for this column and decreases the widths of columns with an unspecified width. However, if you set the Width for all columns, or if specific columns whose width is not defined already reached their MinWidth value, the grid adjusts the width of all other columns in proportion to their defined Width but not less than MinWidth.
 

ColumnsAutoWidth = false
A column’s width is specified by its Width property. If the total column width exceeds the grid’s width, horizontal scrolling is enabled.

Grid in the StackLayout Container

DataGridView (New)

GridControl (Legacy)

The grid height is equal to the height of the device’s screen, regardless of the number of data items.

The grid can change its height to show all data rows.

Miscellaneous

The new grid’s CustomizeCellDisplayTextEventHandler has a sender parameter.

Renamed API

DataGridView (New)

GridControl (Legacy)

Namespace: DevExpress.XamarinForms.*

Namespace: DevExpress.Mobile.*

CheckBoxColumn

SwitchColumn

Tap
TapConfirmed
DoubleTap
LongPress

RowTap
RowDoubleTap

DataGridView.SelectedItem

GridControl.SelectedDataObject

DataGridView.GetGroup(Int32)

GridControl.GetGroupInfo(Int32)

IGroupInfo.GroupValue

IGroupInfo.Value

DataGridView.GroupCollapsing
DataGridView.GroupExpanding
DataGridView.GroupCollapsed
DataGridView.GroupExpanded

GridControl.GroupRowCollapsing
GridControl.GroupRowExpanding
GridControl.GroupRowCollapsed
GridControl.GroupRowExpanded

GridColumn.HorizontalContentAlignment

GridColumn.ContentAlignment

GridColumn.HeaderContentTemplate

GridColumn.HeaderTemplate

CellData.Item

CellData.Source

DataGridView.SelectionChanged event’s argument type:
SelectionChangedEventArgs with the Item property

GridControl.SelectionChanged event’s argument type:
RowEventArgs

DataGridView.OpenEditor(Int32, String)

GridControl.OpenEditor(CellIndex)

DataGridView.CustomCellStyle

GridControl.CustomizeCell