Grid Control Performance Improvement
Grid Control Performance Improvement
Performance
Improvement
Oct 09, 2020
This section provides recommendations that help you create high performance
WPF applications using the DevExpress Grid Control. These address the following
usage cases.
Scrolling Speed
Expanded Vertical Scrolling with Cascading Data
Updates
The Cascading Data Updates feature is aimed to speed up the GridControl's
performance while scrolling data rows. Initially, when an end user scrolls grid
rows, the grid synchronously loads all rows that should be displayed onscreen.
With the enabled cascading data updates, visible rows are asynchronously
loaded. To enable this feature, set
the TableView.AllowCascadeUpdate / TreeListView.AllowCascadeUpdate property
to true.
To enable asynchronous update of group summaries, set
the TableView.AllowGroupSummaryCascadeUpdate property to true.
To provide visual feedback, the grid plays an animation after row data has been
retrieved from a data source. Multiple settings enable you to fine tune the
animation effect. These settings are:
Animation Effect
Animation Duration
By default, the grid displays rows that are being loaded by animating their
opacity. Use the DataViewBase.RowOpacityAnimationDuration property to
specify the length of an animation in milliseconds.
#Expanded Horizontal UI Virtualization
The horizontal UI virtualization feature improves the GridControl's performance
when the control cannot display all its columns on a screen. When horizontal
virtualization is enabled, the GridControl loads only the visible cells. Once
generated, cells are reused to render the newly loaded columns when the user
scrolls the grid horizontally.
Depending on the size of your data source, the amount and frequency of
updates, it may be useful to lock the GridControl and update it after all the data
is updated.
Use
the DataControlBase.BeginDataUpdate and DataControlBase.EndDataUpdate met
hods to prevent the control's internal data updates:
C#
Optimized Mode
The GridControl uses lightweight templates to render its UI elements
in optimized mode. This mode improves scrolling performance and reduces
subsequent load times after loading the first instance.
# In-place Editing
The GridControl's cell displays an in-placed data editor in edit mode when an end
user edits a cell. Otherwise, the GridControl's cell displays its value in one of the
following ways:
ButtonEdit
PopupCalcEdit
CheckEdit
ComboBoxEdit
DateEdit
LookUpEdit
PopupBaseEdit
SpinEdit
TextEdit
XAML
DevExpress.Xpf.Grid.GridRow DevExpress.Xpf.Grid.RowControl
XAML XAML
{dxgt:GridRowThemeKey {dxgt:GridRowThemeKey
ResourceKey=RowControlTemplate} ResourceKey=RowTemplate}
DevExpress.Xpf.Grid.GridRowContent
XAML
{dxgt:GridRowThemeKey
ResourceKey=RowControlContainerTemplate}
DevExpress.Xpf.Grid.RowIndicatorControl DevExpress.Xpf.Grid.RowIndicator
XAML XAML
{dxgt:RowIndicatorThemeKey {dxgt:RowIndicatorThemeKey
ResourceKey=ItemTemplate} ResourceKey=RowIndicatorTemplate}
{dxgt:RowIndicatorThemeKey
ResourceKey=RowTemplate}
DevExpress.Xpf.Grid.DetailRowsIndentControl -
DevExpress.Xpf.Grid.RowOffsetPresenter -
XAML
{dxgt:RowIndicatorThemeKey
ResourceKey=RowOffsetTemplate}
DevExpress.Xpf.Grid.GridCellContentPresenter DevExpress.Xpf.Grid.LightweightCellEditor
XAML
{dxgt:GridRowThemeKey
ResourceKey=CellContentPresenterTemplate}
XAML XAML
{dxgt:GridRowThemeKey {dxgt:GridRowThemeKey
ResourceKey=FixedColumnsDelimiterTemplate} ResourceKey=FixedLineSeparatorTemplat
DevExpress.Xpf.Grid.GroupRowContentPresenter DevExpress.Xpf.Grid.GroupRowControl
You should change the following target types to use the Optimized mode:
XAML
{dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}
NOTE
When the view's cell or row styles and templates are specified before setting
the UseLightweightTemplates value, an exception occurs. You can avoid
exceptions using any of the following workarounds:
Specify the view's cell or row styles and templates after setting
the UseLightweightTemplates value.
# Limitations
TableView.DefaultDataRowTemplate and TableView.RowDecorationTemplate are
not supported in optimized mode.
TableView.RowDetailsTemplate and TableView.RowDetailsTemplateSelector are
only supported in optimized mode.