List<Customer> list = new List<Customer>();
list.Add(new Customer() { Name = "Nancy", Country = "Japan", City = "Tokyo", });
list.Add(new Customer() { Name = "Janet", Country = "Japan", City = "Sendai", });
list.Add(new Customer() { Name = "Rose", Country = "Japan", City = "Tokyo", });
list.Add(new Customer() { Name = "Buchanan", Country = "Japan", City = "Osaka", });
list.Add(new Customer() { Name = "Leverling", Country = "Japan", City = "Tokyo", });
list.Add(new Customer() { Name = "Gavin", Country = "China", City = "Beijing", });
list.Add(new Customer() { Name = "Victoria", Country = "China", City = "Xi'An", });
list.Add(new Customer() { Name = "Apple", Country = "China", City = "Beijing", });
list.Add(new Customer() { Name = "Tim", Country = "China", City = "Beijing", });
list.Add(new Customer() { Name = "John", Country = "China", City = "Xi'An", });
gcSpreadGrid1.ItemsSource = list;
SpreadSortDescription sortDescription1 = new SpreadSortDescription();
sortDescription1.ColumnName = "Country";
gcSpreadGrid1.SortDescriptions.Add(sortDescription1);
SpreadSortDescription sortDescription2 = new SpreadSortDescription();
sortDescription2.ColumnName = "City";
gcSpreadGrid1.SortDescriptions.Add(sortDescription2);
gcSpreadGrid1.Columns["Country"].MergePolicy = MergePolicy.Always;
gcSpreadGrid1.Columns["City"].MergePolicy = MergePolicy.Restricted;
Dim list As New List(Of Customer)()
list.Add(New Customer() With { _
.Name = "Nancy", _
.Country = "Japan", _
.City = "Tokyo" _
})
list.Add(New Customer() With { _
.Name = "Janet", _
.Country = "Japan", _
.City = "Sendai" _
})
list.Add(New Customer() With { _
.Name = "Rose", _
.Country = "Japan", _
.City = "Tokyo" _
})
list.Add(New Customer() With { _
.Name = "Buchanan", _
.Country = "Japan", _
.City = "Osaka" _
})
list.Add(New Customer() With { _
.Name = "Leverling", _
.Country = "Japan", _
.City = "Tokyo" _
})
list.Add(New Customer() With { _
.Name = "Gavin", _
.Country = "China", _
.City = "Beijing" _
})
list.Add(New Customer() With { _
.Name = "Victoria", _
.Country = "China", _
.City = "Xi'An" _
})
list.Add(New Customer() With { _
.Name = "Apple", _
.Country = "China", _
.City = "Beijing" _
})
list.Add(New Customer() With { _
.Name = "Tim", _
.Country = "China", _
.City = "Beijing" _
})
list.Add(New Customer() With { _
.Name = "John", _
.Country = "China", _
.City = "Xi'An" _
})
gcSpreadGrid1.ItemsSource = list
Dim sortDescription1 As New SpreadSortDescription()
sortDescription1.ColumnName = "Country"
gcSpreadGrid1.SortDescriptions.Add(sortDescription1)
Dim sortDescription2 As New SpreadSortDescription()
sortDescription2.ColumnName = "City"
gcSpreadGrid1.SortDescriptions.Add(sortDescription2)
gcSpreadGrid1.Columns("Country").MergePolicy = MergePolicy.Always
gcSpreadGrid1.Columns("City").MergePolicy = MergePolicy.Restricted