GrapeCity SPREAD for WPF 2.0J
MergePolicy プロパティ (Column)

この列の同じ値を持つセルのマージ方法を表す値を取得または設定します。
構文
'Declaration
 
Public Property MergePolicy As MergePolicy
public MergePolicy MergePolicy {get; set;}

プロパティ値

この列の同じ値を持つセルのマージ方法を表す MergePolicy 値。既定値は MergePolicy.None です。
解説
マージポリシーは、LayoutModeLayoutMode.Template の場合には効果がありません。
次のサンプルは顧客一覧を表示します。
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
参照

Column クラス
Column メンバ

 

 


Copyright © 2012 GrapeCity inc. All rights reserved.