ダイナミック セルスタイルを設定するオブジェクトによって動作が異なる
対象製品
MultiRow for Windows Forms 10.0J
詳細
ダイナミック セルスタイルは、設定されたオブジェクトによって発生回数や取得できる情報が異なります。この違いはDynamicCellStyleContext.CellStyleScopeプロパティで確認できます。
[Visual Basic]
[C#]
[Visual Basic]
Imports GrapeCity.Win.MultiRow Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dynamicCellStyle1 As New DynamicCellStyle() dynamicCellStyle1.ConditionHandler = New DynamicCellStyleConditionHandler(AddressOf MyCondition) Dim template1 As Template = Template.Default template1.Row.DefaultCellStyle = dynamicCellStyle1 GcMultiRow1.Template = template1 GcMultiRow1.RowCount = 3 GcMultiRow1.DefaultCellStyle = dynamicCellStyle1 End Sub Private Function MyCondition(ByVal context As DynamicCellStyleContext) As CellStyle Dim newCellStyle As New CellStyle() Console.WriteLine(context.CellStyleScope.ToString()) Return newCellStyle End Function
[C#]
using GrapeCity.Win.MultiRow; private void Form1_Load(object sender, EventArgs e) { DynamicCellStyle dynamicCellStyle1 = new DynamicCellStyle(); dynamicCellStyle1.ConditionHandler = new DynamicCellStyleConditionHandler(MyCondition); Template template1 = Template.Default; template1.Row.DefaultCellStyle = dynamicCellStyle1; gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 3; gcMultiRow1.DefaultCellStyle = dynamicCellStyle1; } private CellStyle MyCondition(DynamicCellStyleContext context) { CellStyle newCellStyle = new CellStyle(); Console.WriteLine(context.CellStyleScope.ToString()); return newCellStyle; }