ダイナミック セルスタイルを匿名メソッドで記述するには?
対象製品
MultiRow for Windows Forms 10.0J
詳細
ダイナミック セルスタイルの適用条件を匿名メソッドで記述するには、DynamicCellStyleクラスのコンストラクタの引数を使用します。
[C#]
[C#]
using GrapeCity.Win.MultiRow; Template template1 = Template.Default; DynamicCellStyle dynamicCellStyle1 = new DynamicCellStyle(delegate(DynamicCellStyleContext context) { CellStyle backColorCellStyle = new CellStyle(); if (context.CellScope == CellScope.Row && (context.RowIndex % 2) == 0) { backColorCellStyle.BackColor = Color.LightBlue; } else { backColorCellStyle.BackColor = Color.LightCoral; } return backColorCellStyle; }); template1.Row.DefaultCellStyle = dynamicCellStyle1; gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 20;