Version

We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.

Improving Horizontal Scrolling Using CellControlGenerationMode Property

Topic Overview

Purpose

This topic describes how the horizontal scrolling can be improved if many columns are displayed in the xamGrid™ control.

Required background

The following topic is a prerequisite to understanding this topic:

Topic Purpose

This topic describes the virtualization in the xamGrid control.

In this topic

This topic contains the following sections:

Configuring Smooth Horizontal Scrolling

Overview

It is essential for the virtualization process that the visual elements are only created when they are in view in the xamGrid control.

By default, a CellControl instance is created when a cell comes into view and this instance is used only for this particular cell and it is never recycled. The same behavior is achieved if the CellControlGenerationMode is set to Virtualize.

If the CellControlGenerationMode is set to Recycle, the CellControl instances are recycled and reused by the cells in the same row when a horizontal scrolling is performed.

Property settings

The following table maps the desired configuration to the property settings that manage it.

In order to: Use this property: And set it to:

Recycle and reuse the CellControl instances by the cells in the same row when scrolling.

Example

Following is the code that implements this example.

In XAML:

<ig:XamGrid x:Name="dataGrid" ItemsSource="{Binding Path=Customers}" CellControlGenerationMode="Recycle" />

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic describes how to control the virtualization process in the xamGrid control.