DataGridViewRow.GetErrorText(Int32) Method

Definition

Gets the error text for the row at the specified index.

public:
 System::String ^ GetErrorText(int rowIndex);
public string GetErrorText (int rowIndex);
member this.GetErrorText : int -> string
Public Function GetErrorText (rowIndex As Integer) As String

Parameters

rowIndex
Int32

The index of the row that contains the error.

Returns

String

A string that describes the error of the row at the specified index.

Exceptions

The row belongs to a DataGridView control and is a shared row.

The row belongs to a DataGridView control and rowIndex is less than zero or greater than the number of rows in the control minus one.

Remarks

Pass the GetErrorText method the index you used to retrieve the DataGridViewRow. Do not use the Index property for the rowIndex parameter. If the row is shared, Index is -1, which is an invalid value for rowIndex. For more information about row sharing, see Best Practices for Scaling the Windows Forms DataGridView Control.

Applies to

See also