Back to Devexpress

VGridControlBase.GetLast() Method

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-7b482889.md

latest3.0 KB
Original Source

VGridControlBase.GetLast() Method

Returns the last row.

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

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

Declaration

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

Returns

TypeDescription
BaseRow

A BaseRow descendant that represents the last row. null ( Nothing in Visual Basic) if the vertical grid has no rows.

|

Remarks

The GetLast method accesses the control’s VGridControlBase.Rows collection and returns the last element. To obtain the last visible row use the VGridControlBase.GetLastVisible method.

Example

The following sample code demonstrates how to make visible all hidden category rows. The VGridControlBase.GetPrev and VGridControlBase.GetLast methods are used to traverse through the rows.

csharp
private void HideAllCategoryRows(){
   BaseRow row = vGridControl1.GetLast();
   while (row != null){
      if ((row is CategoryRow) && (row.Visible == false)){
         row.Visible = true;
      }
      row = vGridControl1.GetPrev(row);
   }
}
vb
Private Sub HideAllCategoryRows()
   Dim row As BaseRow = VGridControl1.GetLast()
   While Not row Is Nothing
      If TypeOf row Is CategoryRow And row.Visible = False Then
         row.Visible = True
      End If
      row = VGridControl1.GetPrev(row)
   End While
End Sub

See Also

GetFirst()

GetPrev(BaseRow)

GetNext(BaseRow)

Cells

VGridControlBase Class

VGridControlBase Members

DevExpress.XtraVerticalGrid Namespace