Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

VGridControlBase.GetPrev(BaseRow) Method

Returns the row previous to the specified one.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.2.dll

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

#Declaration

public BaseRow GetPrev(
    BaseRow row
)

#Parameters

Name Type Description
row BaseRow

A BaseRow descendant that represents the row whose previous row is returned.

#Returns

Type Description
BaseRow

A BaseRow descendant that represents the row previous to the specified one.

#Remarks

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 row specified as the parameter is the null reference or belongs to another vertical grid;
  • the row specified as the parameter is the first row.

#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.

private void HideAllCategoryRows(){
   BaseRow row = vGridControl1.GetLast();
   while (row != null){
      if ((row is CategoryRow) && (row.Visible == false)){
         row.Visible = true;
      }
      row = vGridControl1.GetPrev(row);
   }
}
See Also