windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-dot-getprev-x28-devexpress-dot-xtraverticalgrid-dot-rows-dot-baserow-x29.md
Returns the row previous to the specified one.
Namespace : DevExpress.XtraVerticalGrid
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
public BaseRow GetPrev(
BaseRow row
)
Public Function GetPrev(
row As BaseRow
) As BaseRow
| Name | Type | Description |
|---|---|---|
| row | BaseRow |
A BaseRow descendant that represents the row whose previous row is returned.
|
| Type | Description |
|---|---|
| BaseRow |
A BaseRow descendant that represents the row previous to the specified one.
|
The GetPrev method gets the row previous to the specified one. This can be especially useful when rows are arranged in a tree structure. The GetPrev method returns the null reference in the instances listed below:
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.
private void HideAllCategoryRows(){
BaseRow row = vGridControl1.GetLast();
while (row != null){
if ((row is CategoryRow) && (row.Visible == false)){
row.Visible = true;
}
row = vGridControl1.GetPrev(row);
}
}
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