Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataGridViewRow.AdjustRowHeaderBorderStyle Method

Modifies an input row header border style according to the specified criteria.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
public virtual DataGridViewAdvancedBorderStyle AdjustRowHeaderBorderStyle(
	DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
	DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder,
	bool singleVerticalBorderAdded,
	bool singleHorizontalBorderAdded,
	bool isFirstDisplayedRow,
	bool isLastVisibleRow
)

Parameters

dataGridViewAdvancedBorderStyleInput
Type: System.Windows.Forms.DataGridViewAdvancedBorderStyle
A DataGridViewAdvancedBorderStyle that represents the row header border style to modify.
dataGridViewAdvancedBorderStylePlaceholder
Type: System.Windows.Forms.DataGridViewAdvancedBorderStyle
A DataGridViewAdvancedBorderStyle that is used to store intermediate changes to the row header border style.
singleVerticalBorderAdded
Type: System.Boolean
true to add a single vertical border to the result; otherwise, false.
singleHorizontalBorderAdded
Type: System.Boolean
true to add a single horizontal border to the result; otherwise, false.
isFirstDisplayedRow
Type: System.Boolean
true if the row is the first row displayed in the DataGridView; otherwise, false.
isLastVisibleRow
Type: System.Boolean
true if the row is the last row in the DataGridView that has its Visible property set to true; otherwise, false.

Return Value

Type: System.Windows.Forms.DataGridViewAdvancedBorderStyle
A DataGridViewAdvancedBorderStyle that represents the new border style used.

The DataGridView control internally calls the AdjustRowHeaderBorderStyle method to determine the appearance of the borders for the row header cells. The DataGridView control typically uses the value of the AdvancedRowHeadersBorderStyle property for the dataGridViewAdvancedBorderStyleInput parameter.

Notes to Inheritors

Override this method if you want to customize the appearance of the borders of row header cells.

The following code example demonstrates how to override the AdjustRowHeaderBorderStyle method to customize the borders of the row header cells. This code example is part of a larger example provided for the DataGridViewAdvancedBorderStyle class.


public override DataGridViewAdvancedBorderStyle AdjustRowHeaderBorderStyle(
    DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
    DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceHolder,
    bool singleVerticalBorderAdded,
    bool singleHorizontalBorderAdded,
    bool isFirstDisplayedRow,
    bool isLastDisplayedRow)
{
    // Customize the top border of the first row header and the
    // right border of all the row headers. Use the input style for 
    // all other borders.
    dataGridViewAdvancedBorderStylePlaceHolder.Top = isFirstDisplayedRow ?
        DataGridViewAdvancedCellBorderStyle.InsetDouble :
        DataGridViewAdvancedCellBorderStyle.None;
    dataGridViewAdvancedBorderStylePlaceHolder.Right =
        DataGridViewAdvancedCellBorderStyle.OutsetDouble;

    dataGridViewAdvancedBorderStylePlaceHolder.Left =
        dataGridViewAdvancedBorderStyleInput.Left;
    dataGridViewAdvancedBorderStylePlaceHolder.Bottom =
        dataGridViewAdvancedBorderStyleInput.Bottom;

    return dataGridViewAdvancedBorderStylePlaceHolder;
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.