DataGridViewRow
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Represents a row in a DataGridView control.
- C#
- VB.NET
public class DataGridViewRow : DataGridViewBand
Public Class DataGridViewRow
Inherits DataGridViewBand
Constructors
DataGridViewRow()
Initializes a new instance of the DataGridViewRow class.
DataGridViewRow(dataGridView)
Initializes a new instance of the DataGridViewRow class bound to a DataGridView. This constructor is used to create the RowTemplate object at design time.
| Name | Type | Description |
|---|---|---|
| dataGridView | DataGridView |
Properties
CellCount
Int32: Returns the number of cells in the cell collection without forcing the creation of the collection.
Cells
DataGridViewCellCollection: Returns the collection of cells that populate the row.
Value: A DataGridViewCellCollection that contains all of the cells in the row.
ChildRows
DataGridViewChildRowCollection: Returns the collection of child rows.
ClientIndex
Int32: Returns the row index on the client, accounting for hidden rows.
ContextMenu
ContextMenu: Returns or sets the context menu for the row. (Default: null)
Value: The ContextMenu associated with the current DataGridViewRow. The default is null.
DataBoundItem
Object: Returns the data-bound object that populated the row.
Value: The data-bound Object.
DefaultCellStyle
DataGridViewCellStyle: Returns or sets the default styles for the row, which are used to render cells in the row unless the styles are overridden.
Value: The DataGridViewCellStyle to be applied as the default style.
DefaultMinimumSize
Int32: Returns the default minimum height saving an entry in the property store.
DefaultSize
Int32: Returns the default row height.
Displayed
Boolean: Returns a value indicating whether this row is displayed on the screen.
Value: true if the row is currently displayed on the screen; otherwise, false.
ErrorText
String: Returns or sets the error message text for row-level errors. (Default: "")
Value: A String containing the error message.
Frozen
Boolean: Returns or sets whether a row will move when a user scrolls the DataGridView control vertically. (Default: False)
Value: true to freeze the column; otherwise, false.
HeaderCell
DataGridViewRowHeaderCell: Returns or sets the row's header cell.
Value: A DataGridViewRowHeaderCell that represents the header cell of row.
Height
Int32: Returns or sets the current height of the row.
Value: The height, in pixels, of the row.
IsChild
Boolean: Returns whether the row is a child row.
IsExpanded
Boolean: Returns or sets whether the parent row is expanded.
IsNewRow
Boolean: Returns a value indicating whether the row is the row for new records.
Value: true if the row is the last row in the DataGridView, which is used for the entry of a new row of data; otherwise, false.
IsParent
Boolean: Returns or sets whether the row is a parent row and can be expanded.
Setting this property to true when the row doesn't have any children, will cause the row to expand anyway and request the child rows from the server.
IsRow
Boolean: Returns true when the implementation class is DataGridViewRow.
Item(column)
DataGridViewCell: Returns or sets the cell at the provided index location.
Value: The DataGridViewCell stored at the given index.
Throws:
- InvalidOperationException The specified cell when setting this property already belongs to a DataGridView control, or the specified cell when setting this property already belongs to a DataGridViewRow
- ArgumentException The specified column does not belong to the same DataGridView that owns the cells.
- ArgumentOutOfRangeException The index of the specified column is less than 0 or is equal to or greater than the number of cells in the collection.
Item(index)
DataGridViewCell: Returns or sets the cell at the provided index location.
Value: The DataGridViewCell stored at the given index.
Throws:
- ArgumentNullException The specified value when setting this property is null.
- InvalidOperationException The specified cell when setting this property already belongs to a DataGridView control, or the specified cell when setting this property already belongs to a DataGridViewRow.
- ArgumentOutOfRangeException index is less than 0 or index is equal to or greater than the number of cells in the collection.
Item(columnName)
DataGridViewCell: Returns or sets the cell in the column with the provided name.
Value: The DataGridViewCell stored in the column with the given name.
Throws:
- ArgumentException columnName does not match the name of any columns in the control.
- ArgumentNullException The specified value when setting this property is null.
- InvalidOperationException The specified cell when setting this property already belongs to a DataGridView control, or the specified cell when setting this property already belongs to a DataGridViewRow.
Level
Int32: Returns the child nesting level of this row.
Value: An integer representing the level of indentation of the child row.
MaximumHeight
Int32: Returns or sets the maximum height of the row.
Value: The maximum row height in pixels. The default is 32000.
Throws:
- ArgumentOutOfRangeException The specified value when setting this property is less than 0 or greater than 32000.
MinimumHeight
Int32: Returns or sets the minimum height of the row.
Value: The minimum row height in pixels. The default is 20.
Throws:
- ArgumentOutOfRangeException The specified value when setting this property is less than 2 or greater than 32000.
ParentRow
DataGridViewRow: Returns or sets the parent row.
When a row has a parent row, it is displayed as child row in a tree-like structure. To enumerate all the child rows use the ChildRows property.
When changing the parent row, Wisej tries to enforce the correct sequence of rows in the structure like this:
- The preceding rows with null parent will also become child rows using the same parent.
- If the parent being assigned is not a direct ancestor, it will throw an exception.
- When setting the parent to null, all the following rows that are not descendants will also lose their parent.
- When adding or inserting a row, the new row will receive the same parent as the row at the location it is being inserted at.
Throws:
- ArgumentException When the parent is not a valid ancestor and it would cause break in the tree sequence.
ReadOnly
Boolean: Returns or sets whether the row is read-only. (Default: False)
Value: true if the row is read-only; otherwise, false.
Resizable
DataGridViewTriState: Returns or sets whether users can resize the row or indicating that the behavior is inherited from the AllowUserToResizeRows property.
Value: A DataGridViewTriState value that indicates whether the row can be resized or whether it can be resized only when the AllowUserToResizeRows property is set to true.
RootRow
DataGridViewRow: Returns the parent top-level parent row.
Selected
Boolean: Returns or sets whether the row is selected.
Value: true if the row is selected; otherwise, false.
Visible
Boolean: Returns or sets whether the row is visible. (Default: True)
Value: true if the row is visible; otherwise, false.
Methods
Clone()
Creates a copy of this row.
Returns: Object. The cloned DataGridViewRow.
Collapse()
Collapse the row and hides all the child rows.
CollapseAll()
Collapse the row and all the child rows.
ContainsRow(row)
Checks whether the specified row is a child of this row, or a child of a child of this row.
| Parameter | Type | Description |
|---|---|---|
| row | DataGridViewRow | The row to find in the child row collections. |
Returns: Boolean. True if the specified row is a child of this row, or a child of a child of this row.
CreateCellsInstance()
Constructs a new collection of cells based on this row.
Returns: DataGridViewCellCollection. The newly created DataGridViewCellCollection.
Expand()
Expands the row and shows all the child rows.
ExpandAll()
Expands the row and all the child rows, showing all the child rows at all levels.
GetErrorText()
Returns the error text for the row at the specified index.
Returns: String. A string that describes the error of the row at the specified index.
ResetHeight()
Resets the row height.
SetValues(values)
Sets the values of the row's cells.
| Parameter | Type | Description |
|---|---|---|
| values | Object[] | One or more objects that represent the cell values in the row. or An Array of Object values. |
Returns: Boolean. True if at least one of the values has been set; otherwise, false.
Throws:
- ArgumentNullException values is null.
- InvalidOperationException This method is called when the associated DataGridView is operating in virtual mode.
Update()
Updates the cell on the client.
Inherited By
| Name | Description |
|---|---|
| DataGridViewSummaryRow | Represents a summary row in a DataGridView control. |
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |