バージョン

MergedCellStyle プロパティ (UltraGridOverride)

セルを結合するかどうか、そしてセル結合の方法を指定します。デフォルト値は Never に解決されます。
シンタックス
'宣言
 
Public Property MergedCellStyle As MergedCellStyle
public MergedCellStyle MergedCellStyle {get; set;}
解説
MergedCellEvaluator プロパティは、結合するセルを決定するカスタム ロジックを指定するために使用できます。IMergedCellEvaluator インターフェイスは結合セルのカスタム ロジックを指定するために実装される必要があります。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ultraGrid1.InitializeLayout
        ' Set the MergedCellStyle property to enable the merged cell functionality.
        ' MergedCellStyle also specifies which columns will merge their cells.
        ' OnlyWhenSorted specifies that only sort columns will merge their cells.
        e.Layout.Override.MergedCellStyle = MergedCellStyle.OnlyWhenSorted

        ' MergedCellContentArea specifies whether to render the contents of merged
        ' cells in their visible area. Setting the property to VirtualRect will
        ' render the contents in the full area of the merged cell even if the merged
        ' cell is partially scrolled out of view.
        e.Layout.Override.MergedCellContentArea = MergedCellContentArea.VisibleRect

        ' Set the appearance of merged cells.
        e.Layout.Override.MergedCellAppearance.BackColor = Color.LightYellow
        e.Layout.Override.MergedCellAppearance.ForeColor = Color.Blue

        ' You can override these settings on a specific band by using the override
        ' object of that band.
        e.Layout.Bands(1).Override.MergedCellStyle = MergedCellStyle.Never

        ' You can also override them on a specific column as well.
        e.Layout.Bands(0).Columns(0).MergedCellStyle = MergedCellStyle.Always
        e.Layout.Bands(0).Columns(0).MergedCellContentArea = MergedCellContentArea.VirtualRect
        e.Layout.Bands(0).Columns(0).MergedCellAppearance.BackColor = Color.Aqua

        ' By default the cells are merged based on the underlying cell values.
        ' Sometimes depending on the type of column and various other format settings
        ' you may want to merge cells based on the display text. You can use
        ' MergedCellEvaluationType property to specify whether to merge cells based
        ' on the value or the display text.
        e.Layout.Bands(0).Columns(0).MergedCellEvaluationType = MergedCellEvaluationType.MergeSameText
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Set the MergedCellStyle property to enable the merged cell functionality.
			// MergedCellStyle also specifies which columns will merge their cells.
			// OnlyWhenSorted specifies that only sort columns will merge their cells.
			e.Layout.Override.MergedCellStyle = MergedCellStyle.OnlyWhenSorted;

			// MergedCellContentArea specifies whether to render the contents of merged
			// cells in their visible area. Setting the property to VirtualRect will
			// render the contents in the full area of the merged cell even if the merged
			// cell is partially scrolled out of view.
			e.Layout.Override.MergedCellContentArea = MergedCellContentArea.VisibleRect;

			// Set the appearance of merged cells.
			e.Layout.Override.MergedCellAppearance.BackColor = Color.LightYellow;
			e.Layout.Override.MergedCellAppearance.ForeColor = Color.Blue;

			// You can override these settings on a specific band by using the override
			// object of that band.
			e.Layout.Bands[1].Override.MergedCellStyle = MergedCellStyle.Never;

			// You can also override them on a specific column as well.
			e.Layout.Bands[0].Columns[0].MergedCellStyle = MergedCellStyle.Always;
			e.Layout.Bands[0].Columns[0].MergedCellContentArea = MergedCellContentArea.VirtualRect;
			e.Layout.Bands[0].Columns[0].MergedCellAppearance.BackColor = Color.Aqua;

			// By default the cells are merged based on the underlying cell values.
			// Sometimes depending on the type of column and various other format settings
			// you may want to merge cells based on the display text. You can use
			// MergedCellEvaluationType property to specify whether to merge cells based
			// on the value or the display text.
			e.Layout.Bands[0].Columns[0].MergedCellEvaluationType = MergedCellEvaluationType.MergeSameText;
		}
参照