GrapeCity.Win.MultiRow.v80 アセンブリ > GrapeCity.Win.MultiRow 名前空間 > GcMultiRow クラス > GetIntersectedHeaderCells メソッド : GetIntersectedHeaderCells(Int32,Int32,Orientation,MultiRowSelectionMode) メソッド |
Public Overloads Function GetIntersectedHeaderCells( _ ByVal rowIndex As Integer, _ ByVal cellIndex As Integer, _ ByVal direction As Orientation, _ ByVal mode As MultiRowSelectionMode _ ) As HeaderCell()
public HeaderCell[] GetIntersectedHeaderCells( int rowIndex, int cellIndex, Orientation direction, MultiRowSelectionMode mode )
例外 | 解説 |
---|---|
System.ArgumentOutOfRangeException | rowIndexが0未満か、RowCount - 1を超えています。 または |
System.ComponentModel.InvalidEnumArgumentException | directionがSystem.Windows.Forms.Orientation値の1つではありません。 または modeがMultiRowSelectionMode値の1つではありません。 |
System.ArgumentException | modeがMultiRowSelectionMode.ContainedCellsとMultiRowSelectionMode.IntersectedCellsのどちらでもありません。 |
void gcMultiRow1_CellPainting(object sender, CellPaintingEventArgs e) { if (!this.gcMultiRow1.CurrentCellPosition.IsEmpty) { //Retrieve all HeaderCells from ColumnHeaderSection. HeaderCell[] verticalHeaderCells = this.gcMultiRow1.GetIntersectedHeaderCells(this.gcMultiRow1.CurrentCellPosition.RowIndex, this.gcMultiRow1.CurrentCellPosition.CellIndex, Orientation.Vertical, MultiRowSelectionMode.ContainedCells); foreach (HeaderCell item in verticalHeaderCells) { if (e.SectionIndex == item.RowIndex && e.CellIndex == item.CellIndex && e.Scope == CellScope.ColumnHeader) { using (LinearGradientBrush brush = new LinearGradientBrush(e.CellBounds, Color.Pink, Color.Orange, LinearGradientMode.Vertical)) { e.Graphics.FillRectangle(brush, e.CellBounds); } e.PaintForeground(e.ClipBounds); e.CellStyle.Border = new Border(LineStyle.Thin, Color.Orange); e.PaintBorder(e.ClipBounds); e.Handled = true; } } //Retrieve all HeaderCells from Row section. HeaderCell[] horizontalHeaderCells = this.gcMultiRow1.GetIntersectedHeaderCells(this.gcMultiRow1.CurrentCellPosition.RowIndex, this.gcMultiRow1.CurrentCellPosition.CellIndex, Orientation.Horizontal, MultiRowSelectionMode.ContainedCells); foreach (HeaderCell item in horizontalHeaderCells) { if (e.SectionIndex == item.RowIndex && e.CellIndex == item.CellIndex && e.Scope == CellScope.Row) { using (LinearGradientBrush brush = new LinearGradientBrush(e.CellBounds, Color.Pink, Color.Orange, LinearGradientMode.Vertical)) { e.Graphics.FillRectangle(brush, e.CellBounds); } e.PaintForeground(e.ClipBounds); e.CellStyle.Border = new Border(LineStyle.Thin, Color.Orange); e.PaintBorder(e.ClipBounds); e.Handled = true; } } } }
Private Sub gcMultiRow1_CellPainting(ByVal sender As Object, ByVal e As CellPaintingEventArgs) Handles gcMultiRow1.CellPainting If Not Me.gcMultiRow1.CurrentCellPosition.IsEmpty Then 'Retrieve all HeaderCells from ColumnHeaderSection. Dim verticalHeaderCells As HeaderCell() = Me.gcMultiRow1.GetIntersectedHeaderCells(Me.gcMultiRow1.CurrentCellPosition.RowIndex, Me.gcMultiRow1.CurrentCellPosition.CellIndex, Orientation.Vertical, MultiRowSelectionMode.ContainedCells) For Each item As HeaderCell In verticalHeaderCells If e.SectionIndex = item.RowIndex AndAlso e.CellIndex = item.CellIndex AndAlso e.Scope = CellScope.ColumnHeader Then Using brush As New LinearGradientBrush(e.CellBounds, Color.Pink, Color.Orange, LinearGradientMode.Vertical) e.Graphics.FillRectangle(brush, e.CellBounds) End Using e.PaintForeground(e.ClipBounds) e.CellStyle.Border = New Border(LineStyle.Thin, Color.Orange) e.PaintBorder(e.ClipBounds) e.Handled = True End If Next 'Retrieve all HeaderCells from Row section. Dim horizontalHeaderCells As HeaderCell() = Me.gcMultiRow1.GetIntersectedHeaderCells(Me.gcMultiRow1.CurrentCellPosition.RowIndex, Me.gcMultiRow1.CurrentCellPosition.CellIndex, Orientation.Horizontal, MultiRowSelectionMode.ContainedCells) For Each item As HeaderCell In horizontalHeaderCells If e.SectionIndex = item.RowIndex AndAlso e.CellIndex = item.CellIndex AndAlso e.Scope = CellScope.Row Then Using brush As New LinearGradientBrush(e.CellBounds, Color.Pink, Color.Orange, LinearGradientMode.Vertical) e.Graphics.FillRectangle(brush, e.CellBounds) End Using e.PaintForeground(e.ClipBounds) e.CellStyle.Border = New Border(LineStyle.Thin, Color.Orange) e.PaintBorder(e.ClipBounds) e.Handled = True End If Next End If End Sub