Back to Devexpress

VGridControlBase.GetFirst() Method

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-240d1ed6.md

latest2.9 KB
Original Source

VGridControlBase.GetFirst() Method

Returns the first row within the VGridControlBase.Rows collection.

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

csharp
public BaseRow GetFirst()
vb
Public Function GetFirst As BaseRow

Returns

TypeDescription
BaseRow

A BaseRow descendant that represents the first element in the VGridControlBase.Rows collection. null ( Nothing in Visual Basic) if the vertical grid has no rows.

|

Remarks

To get the first visible row use the VGridControlBase.GetFirstVisible method.

Example

The following sample code demonstrates how to traverse downwards through all rows within the VGridControl control. The VGridControlBase.GetFirst and VGridControlBase.GetNext methods are used for this purpose.

csharp
// obtaining the first row within the control
BaseRow row = vGridControl1.GetFirst();
while (row != null){
   // ...
   // perform the desired actions with the processed row
   // ...
   row = vGridControl1.GetNext(row);
}
vb
' obtaining the first row within the control
Dim row As BaseRow = VGridControl1.GetFirst()
While Not row Is Nothing
   ' ...
   ' perform the desired actions with the processed row
   ' ...
   row = VGridControl1.GetNext(row)
End While

See Also

GetPrev(BaseRow)

GetNext(BaseRow)

GetLast()

VGridControlBase Class

VGridControlBase Members

DevExpress.XtraVerticalGrid Namespace