In this post i ll show how to dynamically create grouped columns. This new feature was introduced in Infragitistcs WPF v16.1. This post is based on the previous one, so if you have not read it yet you might want to do so.

The attached behaviour class is more complex in this scenario to support the hierarchical layout as you will see in the ViewModels section.

Deliverable

Demo App - XamDataGrid Dynamic Grouped Columns using Attached Behavior
Demo App – XamDataGrid Dynamic Grouped Columns using Attached Behavior

View

View Models

Here we have more nested setup of the view models. Ideally data models come from business or data access layer go through a ViewModelFactory class that accommodates your scenario.

Behaviour

Source Code

Download.

 

Leave a Reply

Your e-mail address will not be published. Required fields are marked *