Represents a row in a DataGridView control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Initializes a new instance of theclass without using a template.
Gets the DataGridViewRow.DataGridViewRowAccessibleObject assigned to the .
Gets the collection of cells that populate the row.
Gets or sets the shortcut menu for the row.(Overrides DataGridViewBand.ContextMenuStrip.)
Gets the data-bound object that populated the row.
Gets or sets the default styles for the row, which are used to render cells in the row unless the styles are overridden. (Overrides DataGridViewBand.DefaultCellStyle.)
Gets or sets the run-time type of the default header cell.(Inherited from DataGridViewBand.)
Gets a value indicating whether this row is displayed on the screen.(Overrides DataGridViewBand.Displayed.)
Gets or sets the height, in pixels, of the row divider.
Gets or sets the error message text for row-level errors.
Gets or sets a value indicating whether the row is frozen. (Overrides DataGridViewBand.Frozen.)
Gets or sets the row's header cell.
Gets or sets the current height of the row.
Gets the cell style in effect for the row.(Overrides DataGridViewBand.InheritedStyle.)
Gets a value indicating whether the row is the row for new records.
Gets a value indicating whether the band represents a row.(Inherited from DataGridViewBand.)
Gets or sets the minimum height of the row.
Gets or sets a value indicating whether the row is read-only.(Overrides DataGridViewBand.ReadOnly.)
Gets or sets a value indicating whether the row is selected. (Overrides DataGridViewBand.Selected.)
Gets the current state of the row.(Overrides DataGridViewElement.State.)
Gets or sets the object that contains data to associate with the band.(Inherited from DataGridViewBand.)
Gets or sets a value indicating whether the row is visible. (Overrides DataGridViewBand.Visible.)
The DataGridView.RowsDefaultCellStyle property. To set styles for alternating rows, use the DataGridView.AlternatingRowsDefaultCellStyle property. For more information about cell styles, see Cell Styles in the Windows Forms DataGridView Control. You can also use the DataGridView.RowTemplate property to define a row that will be used as a basis for all rows added to the control.class is used to access the individual cell elements, as well as to adjust the appearance and behavior of the row user interface (UI), such as height and cell style. Typically, you will want all rows or most rows in the control to share the same characteristics. To set cell styles for all rows in the control, set the properties of the object returned by the
The DataGridView control will share objects across multiple data rows whenever possible to avoid performance penalties. Unless you are working with large amounts of data and experiencing performance issues, you can typically ignore row sharing. A shared row is indicated by an Index property value of -1. Some members of the class cannot be used with shared rows, but you can unshare a row by accessing it through the DataGridViewRowCollection.Item property. Rows can also become unshared in other ways. To access a row without unsharing it, use the DataGridViewRowCollection.SharedRow method. When working with large amounts of data, you should be aware of how rows are shared and unshared to avoid performance penalties. For more information, see Best Practices for Scaling the Windows Forms DataGridView Control.
Notes to Inheritors:
When you derive from 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.and add new properties to the derived class, be sure to override the
The following code example illustrates the use of this type. This example is part of a larger example available in How to: Manipulate Rows in the Windows Forms DataGridView Control.
' Set row labels. Private Sub Button6_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Button6.Click Dim rowNumber As Integer = 1 For Each row As DataGridViewRow In dataGridView.Rows If row.IsNewRow Then Continue For row.HeaderCell.Value = "Row " & rowNumber rowNumber = rowNumber + 1 Next dataGridView.AutoResizeRowHeadersWidth( _ DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders) End Sub
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.