GrapeCity MultiRow Windows Forms Documentation
Office2007Style Property
Example 


Gets or sets which Microsoft Office 2007 color scheme is used when drawing the HeaderCell.
Syntax
<SRCategoryAttribute("Appearance")>
<DefaultValueAttribute()>
<SRDescriptionAttribute("Indicates which office2007 color schema is used by the header cell.")>
Public Property Office2007Style As Office2007Style
Dim instance As HeaderCell
Dim value As Office2007Style
 
instance.Office2007Style = value
 
value = instance.Office2007Style
[SRCategory("Appearance")]
[DefaultValue()]
[SRDescription("Indicates which office2007 color schema is used by the header cell.")]
public Office2007Style Office2007Style {get; set;}

Property Value

A Office2007Style value that represents the Office 2007 color scheme. The default is Office2007Style.None.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not one of the Office2007Style values.
Remarks
GcMultiRow supports Microsoft Office 2007 styles. For HeaderCell, you can set this property to select a color scheme. Note that the CornerHeaderCell, ColumnHeaderCell, and RowHeaderCell have different effects even when set to the same color scheme. Also, you can set the GcMultiRow control's SplitOffice2007Style and ScrollBarOffice2007Style to set the split line and scroll bar's Office 2007 effect.
Example
The following code example shows how to set the HeaderCells to the Office2007Style. This example is part of a larger example available for the Office2007Style option.
void setBlackStyle_Click(object sender, EventArgs e)
        {
            Template template1 = this.gcMultiRow1.Template;
            //Set ScrollBar to Office 2007 style.
            this.gcMultiRow1.ScrollBarOffice2007Style = Office2007Style.Black;
            //Set Split line to Office 2007 style.
            this.gcMultiRow1.SplitOffice2007Style = Office2007Style.Black;
            //Set HeaderCell's border to Office 2007 Style. You can change the border to any style.
            CellStyle borderStyle = new CellStyle();
            borderStyle.Border = new Border(LineStyle.Thin, Color.FromArgb(255, 181, 182, 181));
            this.gcMultiRow1.ColumnHeadersDefaultHeaderCellStyle = borderStyle;
            this.gcMultiRow1.RowsDefaultHeaderCellStyle = borderStyle;

            //Set HeaderCell to Office2007Style.
            foreach (Cell cell1 in template1.ColumnHeaders[0].Cells)
            {
                HeaderCell headerCell1 = cell1 as HeaderCell;
                if (headerCell1 != null)
                {
                    headerCell1.Office2007Style = Office2007Style.Black;
                }
            }
            HeaderCell rowHeaderCell1 = template1.Row.Cells[template1.Row.Cells.Count - 1] as HeaderCell;
            if (rowHeaderCell1 != null)
            {
                rowHeaderCell1.Office2007Style = Office2007Style.Black;
            }

            this.gcMultiRow1.Template = template1;
        }
Private Sub setBlackStyle_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setBlackStyle.Click
        Dim template1 As Template = Me.gcMultiRow1.Template
        'Set ScrollBar to Office 2007 style.
        Me.gcMultiRow1.ScrollBarOffice2007Style = Office2007Style.Black
        'Set Split line to Office 2007 style.
        Me.gcMultiRow1.SplitOffice2007Style = Office2007Style.Black
        'Set HeaderCell's border to Office 2007 Style. You can change the border to any style.
        Dim borderStyle As New CellStyle()
        borderStyle.Border = New Border(LineStyle.Thin, Color.FromArgb(255, 181, 182, 181))
        Me.gcMultiRow1.ColumnHeadersDefaultHeaderCellStyle = borderStyle
        Me.gcMultiRow1.RowsDefaultHeaderCellStyle = borderStyle

        'Set HeaderCell to Office2007Style.
        For Each cell1 As Cell In template1.ColumnHeaders(0).Cells
            Dim headerCell1 As HeaderCell = TryCast(cell1, HeaderCell)
            If Not headerCell1 Is Nothing Then
                headerCell1.Office2007Style = Office2007Style.Black
            End If
        Next
        Dim rowHeaderCell1 As HeaderCell = TryCast(template1.Row.Cells(template1.Row.Cells.Count - 1), 
HeaderCell)
        If Not rowHeaderCell1 Is Nothing Then
            rowHeaderCell1.Office2007Style = Office2007Style.Black
        End If

        Me.gcMultiRow1.Template = template1
    End Sub
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

HeaderCell Class
HeaderCell Members
Office2007Style Enumeration
SplitOffice2007Style Property
ScrollBarOffice2007Style Property

 

 


Copyright © GrapeCity, inc. All rights reserved.