DataGridViewRow.GetErrorText Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public string GetErrorText(
	int rowIndex


Type: System.Int32

The index of the row that contains the error.

Return Value

Type: System.String

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

Exception Condition

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.

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.

.NET Framework
Available since 2.0
Return to top