All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Bind to Collections Specified in the ViewModel

You can define collections of grid objects (for example, columns or summaries) in a ViewModel and assign them to the GridControl.

To generate grid objects from a ViewModel collection, specify the Source and Generator properties:

Source
Specifies a collection from which the GridControl generates objects.
Generator
Specifies a template used to generate grid objects.

Grid Objects

Source Property

Generator Template

Example

Columns

ColumnsSource

ColumnGeneratorTemplate / ColumnGeneratorTemplateSelector

How to: Bind the Grid to a Collection of Columns

Bands

BandsSource

BandGeneratorTemplate / BandGeneratorTemplateSelector

How to: Bind the Grid to Bands Specified in ViewModel

Total and Group Summaries

TotalSummarySource

TotalSummaryGeneratorTemplate

How to: Bind the Grid to Total and Group Summaries

GroupSummarySource

GroupSummaryGeneratorTemplate

Conditional Formatting Rules

TableView.FormatConditionsSource

TableView.FormatConditionGeneratorTemplate / TableView.FormatConditionGeneratorTemplateSelector

How to: Bind the Grid to a Collection of Conditional Formatting Rules

TreeListView.FormatConditionsSource

TreeListView.FormatConditionGeneratorTemplate / TreeListView.FormatConditionGeneratorTemplateSelector

Selected Items

SelectedItems

Binding to a Collection of Selected Items