GrapeCity.Win.MultiRow.v80 アセンブリ > GrapeCity.Win.MultiRow 名前空間 : RowHeaderCell クラス |
Public Class RowHeaderCell Inherits HeaderCell
public class RowHeaderCell : HeaderCell
RowHeaderCellクラスは、行の情報(ValueFormatに基づく)と行の状態(RowIndicatorに基づく)を表す特別なタイプのHeaderCellです。
継承時の注意:
RowHeaderCellから継承した派生クラスに新しいプロパティを追加するときは、必ずCloneメソッドをオーバーライドして、クローニング操作時に新しいプロパティがコピーされるようにしてください。また、基本クラスのCloneメソッドを呼び出して、基本クラスのプロパティが新しいセルにコピーされるようにしてください。
using System; using System.Windows.Forms; using System.Drawing; namespace GrapeCity.Win.MultiRow.SampleCode { public class RowHeaderCellDemo : Form { private GcMultiRow gcMultiRow1 = new GcMultiRow(); [STAThreadAttribute()] public static void Main() { Application.EnableVisualStyles(); Application.Run(new RowHeaderCellDemo()); } public RowHeaderCellDemo() { this.gcMultiRow1.Dock = DockStyle.Fill; this.Controls.Add(this.gcMultiRow1); this.Load += new EventHandler(Form1_Load); this.Size = new Size(800, 600); this.Text = "RowHeaderCell Demo"; } private void Form1_Load(object sender, EventArgs e) { Template template1 = Template.CreateGridTemplate(10, 80, 21, Int32.MaxValue, AutoGenerateGridTemplateStyles.RowHeader, 50); //Set this property, one error icon glyph will be displayed on the RowHeaderCell, if RowHeaderCell.ShowRowError is false, no icon shown. template1.Row.ErrorText = "Row Error"; RowHeaderCell rowHeaderCell1 = template1.Row.Cells[10] as RowHeaderCell; //Click the RowHeaderCell, the current row will be selected. rowHeaderCell1.SelectionMode = MultiRowSelectionMode.Row; //Set FlatStyle to Flat, and customize some appearances. rowHeaderCell1.FlatStyle = FlatStyle.Flat; rowHeaderCell1.FlatAppearance.BorderColor = Color.Black; rowHeaderCell1.FlatAppearance.BorderSize = 1; rowHeaderCell1.FlatAppearance.MouseDownBackColor = Color.Khaki; rowHeaderCell1.FlatAppearance.MouseOverBackColor = Color.Orange; rowHeaderCell1.Style.BackColor = Color.DarkKhaki; rowHeaderCell1.Style.SelectionBackColor = Color.LightBlue; //The editing icon and new row icon will not display. rowHeaderCell1.ShowIndicator = false; //Set ShowRowError to false to hide the row's error icon. rowHeaderCell1.ShowRowError = false; //Set the RowHeaderCell's caption. it will display "A1, A2, A3, ...". rowHeaderCell1.ValueFormat = "A1"; gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 100; } } }
Imports System Imports System.Windows.Forms Imports System.Drawing Imports GrapeCity.Win.MultiRow Public Class RowHeaderCellDemo Inherits Form Private gcMultiRow1 As New GcMultiRow() <STAThreadAttribute()> _ Public Shared Sub Main() Application.EnableVisualStyles() Application.Run(New RowHeaderCellDemo()) End Sub Public Sub New() Me.gcMultiRow1.Dock = DockStyle.Fill Me.Controls.Add(Me.gcMultiRow1) Me.Size = New Size(800, 600) Me.Text = "RowHeaderCell Demo" End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim template1 As Template = Template.CreateGridTemplate(10, 80, 21, Int32.MaxValue, AutoGenerateGridTemplateStyles.RowHeader, 50) 'Set this property, one error icon glyph will be displayed on the RowHeaderCell, if RowHeaderCell.ShowRowError is false, no icon shown. template1.Row.ErrorText = "Row Error" Dim rowHeaderCell1 As RowHeaderCell = TryCast(template1.Row.Cells(10), RowHeaderCell) 'Click the RowHeaderCell, the current row will be selected. rowHeaderCell1.SelectionMode = MultiRowSelectionMode.Row 'Set FlatStyle to Flat, and customize some appearances. rowHeaderCell1.FlatStyle = FlatStyle.Flat rowHeaderCell1.FlatAppearance.BorderColor = Color.Black rowHeaderCell1.FlatAppearance.BorderSize = 1 rowHeaderCell1.FlatAppearance.MouseDownBackColor = Color.Khaki rowHeaderCell1.FlatAppearance.MouseOverBackColor = Color.Orange rowHeaderCell1.Style.BackColor = Color.DarkKhaki rowHeaderCell1.Style.SelectionBackColor = Color.LightBlue 'The editing icon and new row icon will not display. rowHeaderCell1.ShowIndicator = False 'Set ShowRowError to false to hide the row's error icon. rowHeaderCell1.ShowRowError = False 'Set the RowHeaderCell's caption. it will display "A1, A2, A3, ...". rowHeaderCell1.ValueFormat = "A1" gcMultiRow1.Template = template1 gcMultiRow1.RowCount = 100 End Sub End Class
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
GrapeCity.Win.MultiRow.Cell
GrapeCity.Win.MultiRow.HeaderCell
GrapeCity.Win.MultiRow.RowHeaderCell