GrapeCity MultiRow Windows Forms Documentation
GutterStyles Property
Example 


Gets or sets how the gutter is displayed in the HeaderCell when a Theme is enabled.
Syntax
<SRDescriptionAttribute("Indicates which direction of the HeaderCell has the gutter effect.")>
<SRCategoryAttribute("Appearance")>
<DefaultValueAttribute()>
Public Property GutterStyles As GutterStyles
Dim instance As HeaderCell
Dim value As GutterStyles
 
instance.GutterStyles = value
 
value = instance.GutterStyles
[SRDescription("Indicates which direction of the HeaderCell has the gutter effect.")]
[SRCategory("Appearance")]
[DefaultValue()]
public GutterStyles GutterStyles {get; set;}

Property Value

One of the GutterStyles values that indicates how the gutter is displayed in the HeaderCell when a Theme is enabled. The default is GutterStyles.Right | GutterStyles.Bottom.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not one of the GutterStyles values.
Remarks
You can use this property together with SelectionMode. Setting different values for this property represents different selection modes. For example, set the RowHeaderCell's GutterStyles to GutterStyles.Right, and set the SelectionMode to MultiRowSelectionMode.Row. In this example, position the RowHeaderCell to the far left of the row when designing a template. This represents that all cells to the right of RowHeaderCell are selected when you click the RowHeaderCell.
Example
The following code example shows some important HeaderCell properties. The GutterStyles draws gutters around the HeaderCell and they represent the cell's orientation. The hover effect is drawn by the HoverDirection property. By default, the HeaderCell uses the VistualStyle backcolor to draw the background. To change this set the FlatStyle and UseVisualStyleBackColor and then change the HeaderCell's Style. The SelectionMode property indicates which cells or rows are selected when you click the HeaderCell. This code example is part of a larger example provided for the HeaderCell class.
private ColumnHeaderSection CreateColumnHeader()
        {
            ColumnHeaderSection columnHeader1 = new ColumnHeaderSection();
            columnHeader1.Height = 20;

            HeaderCell headerCell1 = new HeaderCell();
            headerCell1.Size = new Size(36, 20);
            //There are 4 gutters around the HeaderCell.
            headerCell1.GutterStyles = GutterStyles.All;
            headerCell1.HoverDirection = HoverDirection.None;

            //Click the HeaderCell, all rows are selelected.
            headerCell1.SelectionMode = MultiRowSelectionMode.AllRows;

            //Use the CellStyle.BackColor to draw the HeaderCell's background, do not use the VistualStyle backcolor.
            headerCell1.FlatStyle = FlatStyle.Standard;
            headerCell1.UseVisualStyleBackColor = false;
            headerCell1.Style.BackColor = Color.DarkGoldenrod;

            ColumnHeaderCell columnHeaderCell1 = new ColumnHeaderCell();
            columnHeaderCell1.Value = "Column1";
            columnHeaderCell1.Size = new Size(80, 20);
            columnHeaderCell1.Location = new Point(headerCell1.Left + headerCell1.Width, 0);
            columnHeaderCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd;
            columnHeaderCell1.EllipsisString = "....";

            //The cell's right draws a gutter.
            columnHeaderCell1.GutterStyles = GutterStyles.Right;
            //The cell's bottom draws a hover effect.
            columnHeaderCell1.HoverDirection = HoverDirection.Bottom;
            //Use the CellStyle.BackColor to draw the HeaderCell's background, do not use the VistualStyle backcolor.
            columnHeaderCell1.FlatStyle = FlatStyle.Standard;
            columnHeaderCell1.UseVisualStyleBackColor = false;
            columnHeaderCell1.Style.BackColor = Color.DarkGoldenrod;
            columnHeaderCell1.Style.SelectionBackColor = Color.LightBlue;

            ColumnHeaderCell columnHeaderCell2 = columnHeaderCell1.Clone() as ColumnHeaderCell;
            columnHeaderCell2.Location = new Point(columnHeaderCell1.Left + columnHeaderCell1.Width, 0);
            columnHeaderCell2.Value = "Column2";

            columnHeader1.Cells.AddRange(new Cell[] { headerCell1, columnHeaderCell1, columnHeaderCell2 });

            return columnHeader1;
        }
Private Function CreateColumnHeader() As ColumnHeaderSection
        Dim columnHeader1 As New ColumnHeaderSection()
        columnHeader1.Height = 20

        Dim headerCell1 As New HeaderCell()
        headerCell1.Size = New Size(36, 20)
        'There are 4 gutters around the HeaderCell.
        headerCell1.GutterStyles = GutterStyles.All
        headerCell1.HoverDirection = HoverDirection.None

        'Click the HeaderCell, all rows are selelected.
        headerCell1.SelectionMode = MultiRowSelectionMode.AllRows

        'Use the CellStyle.BackColor to draw the HeaderCell's background, do not use the VistualStyle backcolor.
        headerCell1.FlatStyle = FlatStyle.Standard
        headerCell1.UseVisualStyleBackColor = False
        headerCell1.Style.BackColor = Color.DarkGoldenrod

        Dim columnHeaderCell1 As New ColumnHeaderCell()
        columnHeaderCell1.Value = "Column1"
        columnHeaderCell1.Size = New Size(80, 20)
        columnHeaderCell1.Location = New Point(headerCell1.Left + headerCell1.Width, 0)
        columnHeaderCell1.Ellipsis = MultiRowEllipsisMode.EllipsisEnd
        columnHeaderCell1.EllipsisString = "...."

        'The cell's right draws a gutter.
        columnHeaderCell1.GutterStyles = GutterStyles.Right
        'The cell's bottom draws the hover effect.
        columnHeaderCell1.HoverDirection = HoverDirection.Bottom
        'Use the CellStyle.BackColor to draw the HeaderCell's background, do not use the VistualStyle backcolor.
        columnHeaderCell1.FlatStyle = FlatStyle.Standard
        columnHeaderCell1.UseVisualStyleBackColor = False
        columnHeaderCell1.Style.BackColor = Color.DarkGoldenrod
        columnHeaderCell1.Style.SelectionBackColor = Color.LightBlue

        Dim columnHeaderCell2 As ColumnHeaderCell = TryCast(columnHeaderCell1.Clone(), ColumnHeaderCell)
        columnHeaderCell2.Location = New Point(columnHeaderCell1.Left + columnHeaderCell1.Width, 0)
        columnHeaderCell2.Value = "Column2"

        columnHeader1.Cells.AddRange(New Cell() {headerCell1, columnHeaderCell1, columnHeaderCell2})

        Return columnHeader1
    End Function
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

 

 


Copyright © GrapeCity, inc. All rights reserved.