I want to make a DataGrid in WPF, where some of the cells will \"merge together\", if they are alike.
Example:
+---------+------+-----+
Trick to such scenarios is to use the Groups formed in CollectionViewSource as the ItemsSource of a DataGrid. And, use a DataGrid itself as the CellTemplate of Column.
Xaml
DataGrid.Loaded event
private void dg_Loaded(object sender, RoutedEventArgs e)
{
var groups = (this.Resources["CvsKey"] as CollectionViewSource).View.Groups;
dg.ItemsSource = groups;
}
This should get you started.
Output :