GrapeCity MultiRow Windows Forms Documentation
RowHeaderCell Class
Members  Example 


Represents a Cell that can be used to show the indicator and error information of the owner Row in addition to the functions provided by the HeaderCell class.
Object Model
RowHeaderCell ClassMultiRowFlatButtonAppearance ClassGcMultiRow ClassCellStyle ClassCellNote ClassSection ClassCellStyle ClassMultiRowTouchToolBar ClassValidatorCollection ClassCellValidator Class
Syntax
<FeatureAttribute(Name="Cell", Version="v5.0")>
<SRDescriptionAttribute("Displays as a row’s header and provides selection mode and other functions.")>
<ToolboxItemFilterAttribute(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom Or  _
    ToolboxItemFilterType.Prevent Or  _
    ToolboxItemFilterType.Require)>
<ToolboxBitmapAttribute()>
<DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.RowHeaderCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
Public Class RowHeaderCell 
   Inherits HeaderCell
Dim instance As RowHeaderCell
[Feature(Name="Cell", Version="v5.0")]
[SRDescription("Displays as a row’s header and provides selection mode and other functions.")]
[ToolboxItemFilter(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom | 
    ToolboxItemFilterType.Prevent | 
    ToolboxItemFilterType.Require)]
[ToolboxBitmap()]
[Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.RowHeaderCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
public class RowHeaderCell : HeaderCell 
Remarks

The RowHeaderCell class is a special type of HeaderCell. The ValueFormat property in this class is used to represent row information. The RowIndicator property represents the row state.

Only the Row section can own the RowHeaderCell. If you add the RowHeaderCell to other sections such as ColumnHeaderSection or ColumnFooterSection, an exception is thrown.

Notes to Inheritors:

When you derive from RowHeaderCell and add new properties to the derived class, be sure to override the Clone method to copy the new properties during cloning operations. You should also call the base class's Clone method so that the properties of the base class are copied to the new cell.

Example
The following code example shows some important properties of RowHeaderCell. The RowHeaderCell draws the appearance using the HeaderCell.FlatAppearance property. Because the ShowIndicator property is false, the editing and new row icons are not displayed. Although the Row.ErrorText is set, the ShowRowError is false, so the error icon is not displayed in the RowHeaderCell.
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, an error icon glyph is displayed on the RowHeaderCell, if RowHeaderCell.ShowRowError is false, no icon is shown.
            template1.Row.ErrorText = "Row Error";

            RowHeaderCell rowHeaderCell1 = template1.Row.Cells[10] as RowHeaderCell;
            //Click the RowHeaderCell, the current row is selected.
            rowHeaderCell1.SelectionMode = MultiRowSelectionMode.Row;
            //Set FlatStyle to Flat, and customize the appearance.
            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 do 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 displays "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, an error icon glyph is displayed on the RowHeaderCell, if RowHeaderCell.ShowRowError is false, no icon is shown.
        template1.Row.ErrorText = "Row Error"

        Dim rowHeaderCell1 As RowHeaderCell = TryCast(template1.Row.Cells(10), RowHeaderCell)
        'Click the RowHeaderCell, the current row is selected.
        rowHeaderCell1.SelectionMode = MultiRowSelectionMode.Row
        'Set FlatStyle to Flat, and customize the appearance.
        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 do 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 displays "A1, A2, A3, ...".
        rowHeaderCell1.ValueFormat = "A1"

        gcMultiRow1.Template = template1
        gcMultiRow1.RowCount = 100
    End Sub
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         GrapeCity.Win.MultiRow.Cell
            GrapeCity.Win.MultiRow.HeaderCell
               GrapeCity.Win.MultiRow.RowHeaderCell

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RowHeaderCell Members
GrapeCity.Win.MultiRow Namespace
Cell Class
HeaderCell Class
ColumnHeaderCell Class
CornerHeaderCell Class

 

 


Copyright © GrapeCity, inc. All rights reserved.